Created
July 7, 2020 14:42
-
-
Save kurasaiteja/81d51c4064a820fc2fea557fe9f88ff6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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