我想绘制特定日期的散点图。如何仅用两列[周六和周日]绘制散点图?
px.scatter(
df, x="total_bill", y="tip",
color="size", facet_col="day"
)
df.day.value_counts()
Sat 87
Sun 76
Thur 62
Fri 19
Name: day, dtype: int64
这是所有列的散点图。
您只需要过滤df。之前或致电px
import plotly.express as px
df = px.data.tips()
px.scatter(df[df["day"].isin(["Sat", "Sun"])],
x="total_bill",
y="tip",
color="size",
facet_col="day"
)