Funnel Plot in Pandas

Funnel Plot in Pandas

Is there a way to create a funnel plot in Python using Pandas? The documentation does not seem to have something relevant.

1

3 Answers

Better late than never. With plotly you can perform funnels. Here is a simple example

The best solution I found so far is to use matplotlib library along with pandas to create segmented horizontal bar chart. You will need to add one dummy category in order to shift categories to centre. Detailed explanation can be found here.

There's another solution if you want to use the non-segmented bar chart you can create the function, more details can be found here.

#I am new to Python; I figured it out, did the code below, and it worked. #Doing a simple funnel plot with data from a csv file import pandas as pd import plotly.express as px df=pd.read_csv("C:\Users\User\Desktop\file_name.csv")# path and file df= df.sort_values('scores', ascending= False)# True or False for type of sorting print(df.head(5))# preview data fig = px.funnel(df['category_column'].values, df['column_with_float'].values,color='red') fig.show()

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.