Created
September 12, 2022 11:30
-
-
Save Abhayparashar31/166fbada29f37cf47d1f8707ee9ced6c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 get_connectios_count_df(df): | |
temp = df["Connected_on"].value_counts().reset_index() | |
temp.rename(columns={"index": "connected_on", "Connected_on": "count"}, inplace=True) | |
temp['connected_on'] = pd.to_datetime(temp['connected_on']) | |
temp = temp.sort_values(by="connected_on", ascending=True) | |
return temp | |
def plot_timeline(df): | |
temp = get_connectios_count_df(df) | |
fig = px.line(temp, x="connected_on", y="count", | |
labels={ | |
"connected_on":'Timeline', | |
"count":'Number of Connections' | |
}) | |
return fig | |
plot_timeline(df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment