我有这样的数据
import pandas as pd
df = pd.DataFrame(
dict(
week=[1, 1, 2, 2, 3, 3] * 2,
layout=["classic", "classic", "modern", "modern"] * 3,
response=["conversion", "exit"] * 6,
cnt=[26, 23, 45, 34, 55, 44, 53, 27, 28, 25, 30, 34],))
Run Code Online (Sandbox Code Playgroud)
我不能使用两个类别的主要问题。我的代码:
px.bar(
data_frame=df,
x='week',
y='cnt',
template='plotly_dark',
color = 'layout'
)
Run Code Online (Sandbox Code Playgroud)
但我无法像 excel 示例中那样显示有关“响应”的信息