Skip to content

Instantly share code, notes, and snippets.

@kurasaiteja
Created July 7, 2020 14:42
Show Gist options
  • Save kurasaiteja/81d51c4064a820fc2fea557fe9f88ff6 to your computer and use it in GitHub Desktop.
Save kurasaiteja/81d51c4064a820fc2fea557fe9f88ff6 to your computer and use it in GitHub Desktop.
def dayofweek(i):
l = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
return l[i];
day_df=pd.DataFrame(messages_df["Message"])
day_df['day_of_date'] = messages_df['Date'].dt.weekday
day_df['day_of_date'] = day_df["day_of_date"].apply(dayofweek)
day_df["messagecount"] = 1
day = day_df.groupby("day_of_date").sum()
day.reset_index(inplace=True)
fig = px.line_polar(day, r='messagecount', theta='day_of_date', line_close=True)
fig.update_traces(fill='toself')
fig.update_layout(
polar=dict(
radialaxis=dict(
visible=True,
range=[0,6000]
)),
showlegend=False
)
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment