RUVIDEO
Поделитесь видео 🙏

Funnel Chart Plotly || Lesson 3.11 || Python for Data Science || Learning Monkey ||

📁 Обучение 👁️ 16 📅 02.12.2023

Funnel Chart Plotly
In this class, We discuss funnel chart plotly.

The reader should have prior knowledge of the superstore data set. Click here.

From the superstore data set, we use subcategories and profit to construct a funnel chart.

Funnel charts represent a progressive reduction of data from one phase to another.

Funnel Chart
Example
We consider the sales based on a subcategory. The data is sorted based on the sale.

We use plotly express module to construct the funnel chart.

We use the function funnel to construct the funnel chart.

The below example shows the program for the funnel chart.

import pandas as pd
df=pd.read_excel('sampledata.xls',sheet_name='Orders')
print(df.head())

temp=pd.DataFrame(df.groupby(['Sub-Category']).agg({'Sales':'sum'}))
print(temp)

temp1=temp.sort_values('Sales',ascending=0)
print(temp1)

import plotly.express as px
fig = px.funnel(temp1)
fig.show()
The funnel function takes the first record and constructs a bar. Then second record. So on.

As we move down the profit is decreasing. And the graph looks like a funnel.

Stacked Funnel Chart
To construct the stacked funnel chart, we take 2012 and 2013 sales based on a subcategory.

The below code shows the program for taking 2012 and 2013 sales and constructing a funnel chart.

df['year'] = df['Order Date'].dt.year
print(df.head())

df1=df[df['year']==2013]
temp2013=pd.DataFrame(df1.groupby(['Sub-Category']).agg({'Sales':'sum'}))
df2=df[df['year']==2012]
temp2012=pd.DataFrame(df2.groupby(['Sub-Category']).agg({'Sales':'sum'}))
final=pd.concat([temp2013,temp2012],axis=1)
final.columns=['2013sales','2012sales']
sumcolumns=final['2013sales']+final['2012sales']
final['total']=sumcolumns
final1=final.sort_values('total',ascending=0)
print(final1)

import plotly.express as px
fig = px.funnel(final1)
fig.show()
We take 2012 sales in a data frame. And 2013 sales in another data frame.

We concatenate the two data frames column-wise.

After concatenating the sum of the 2012 and 2013 sales for subcategories is identified.

Sort the subcategory according to the total sale obtained above and construct the funnel chart.

Link for playlists:
https://www.youtube.com/channel/UCl8x4Pn9Mnh_C1fue-Yndig/playlists


Link for our website: https://learningmonkey.in

Follow us on Facebook @ https://www.facebook.com/learningmonkey

Follow us on Instagram @ https://www.instagram.com/learningmonkey1/

Follow us on Twitter @ https://twitter.com/_learningmonkey

Mail us @ [email protected]

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Funnel Chart Plotly || Lesson 3.11 || Python for Data Science || Learning Monkey ||», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.