Closed
Description
I grouped a dataframe's datatime column to weekly periods, and when plotted, the x-axis doesn't follow chronologically, even if the dataframe in sorted properly:
Here's the relevant code in case it's helpful:
to_plot = (df.groupby(['colA', df.ad_delivery_start_time.dt.to_period('W').astype(str)])
.size()
.reset_index(name='ads')
.sort_values('ad_delivery_start_time')
)
px.line(to_plot, x='ad_delivery_start_time', y='ads', color = 'colA', height=600)
Metadata
Metadata
Assignees
Labels
No labels