4

I have 1 state on "og"- false, and 2 states on "no og" true and false

is_retargeting media_source step Values
False og step1 31992
True no og step1 33644
False no og step1 32199
False no og step2 20699
False og step2 47796
True no og step2 23668
True no og step3 10744
False no og step3 27622
False og step3 20979
False no og step4 16459
False og step4 28444
True no og step4 49749

i come up with this code, but it shows only 2 colors but breaks "no og" with no explanation. here is the screenshot what i get enter image description here

How can add one more breakdown column is_retargeting for this funnel so it will show true or false for "no og"?

import pandas as pd
pd.set_option('max_columns', None)
df = pd.read_csv("name.csv")

df.loc[df["media_source"] != "organic", "media_source"] = 'non organic'
df = df.groupby(['is_retargeting', 'media_source']).sum().reset_index()
df1 = df.melt(id_vars=["is_retargeting", "media_source"],
        var_name="step",
        value_name="Values")
fig = px.funnel(df1, x='Values', y='step', color='media_source')
fig.show()
Mr. T
  • 11,960
  • 10
  • 32
  • 54
mrDaft
  • 43
  • 6

0 Answers0