Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -44,22 +44,24 @@ if uploaded_file is not None:
|
|
44 |
with col3:
|
45 |
st.header("Links Shared")
|
46 |
st.title(num_links)
|
47 |
-
|
48 |
-
st.title("
|
49 |
-
|
50 |
-
fig,ax=plt.subplots()
|
51 |
-
ax.plot(timeline['time'], timeline['message'])
|
52 |
-
plt.figure(figsize=(10, 8))
|
53 |
-
plt.xticks(rotation='vertical')
|
54 |
-
st.pyplot(fig)
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
st.title("Activity Map")
|
65 |
col1,col2=st.columns(2)
|
@@ -68,21 +70,21 @@ if uploaded_file is not None:
|
|
68 |
st.header("Most busy day")
|
69 |
busy_day=helper.week_activity_map(selected_user, df_new)
|
70 |
fig,ax=plt.subplots()
|
71 |
-
ax.bar(busy_day.index,busy_day.values)
|
72 |
plt.xticks(rotation='vertical')
|
73 |
st.pyplot(fig)
|
74 |
with col2:
|
75 |
st.header("Most busy Month")
|
76 |
busy_day = helper.month_activity_map(selected_user, df_new)
|
77 |
fig, ax = plt.subplots()
|
78 |
-
ax.bar(busy_day.index, busy_day.values)
|
79 |
plt.xticks(rotation='vertical')
|
80 |
st.pyplot(fig)
|
81 |
|
82 |
-
st.title("Weekly Activity
|
83 |
Activity_heatmap=helper.activity_heatmap(selected_user,df_new)
|
84 |
fig,ax=plt.subplots()
|
85 |
-
ax=sns.heatmap(Activity_heatmap)
|
86 |
st.pyplot(fig)
|
87 |
|
88 |
if selected_user == "Group analysis":
|
@@ -92,7 +94,7 @@ if uploaded_file is not None:
|
|
92 |
col1,col2=st.columns(2)
|
93 |
|
94 |
with col1:
|
95 |
-
ax.bar(x.index, x.values)
|
96 |
plt.xticks(rotation='vertical')
|
97 |
st.pyplot(fig)
|
98 |
with col2:
|
@@ -127,11 +129,11 @@ if uploaded_file is not None:
|
|
127 |
fig,ax=plt.subplots()
|
128 |
ax.barh(most_common_df[0],most_common_df[1])
|
129 |
st.pyplot(fig)
|
130 |
-
st.dataframe(most_common_df)
|
131 |
|
132 |
emoji_df=helper.emoji_helper(selected_user,df_new)
|
133 |
st.title("Emoji Analysis")
|
134 |
-
st.dataframe(emoji_df)
|
135 |
|
136 |
|
137 |
st.title("Sentiment Analysis")
|
|
|
44 |
with col3:
|
45 |
st.header("Links Shared")
|
46 |
st.title(num_links)
|
47 |
+
|
48 |
+
st.title("Timeline")
|
49 |
+
col1, col2 = st.columns(2)
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
+
with col1:
|
52 |
+
st.header("Monthly ")
|
53 |
+
timeline = helper.monthly_timeline(selected_user, df_new)
|
54 |
+
fig, ax = plt.subplots()
|
55 |
+
ax.plot(timeline['time'], timeline['message'])
|
56 |
+
plt.xticks(rotation='vertical')
|
57 |
+
st.pyplot(fig)
|
58 |
+
with col2:
|
59 |
+
st.title("Daily")
|
60 |
+
daily_timeline = helper.Daily_timeline(selected_user, df_new)
|
61 |
+
fig, ax = plt.subplots()
|
62 |
+
ax.plot(daily_timeline['Date'], daily_timeline['message'], color='black')
|
63 |
+
plt.xticks(rotation='vertical')
|
64 |
+
st.pyplot(fig)
|
65 |
|
66 |
st.title("Activity Map")
|
67 |
col1,col2=st.columns(2)
|
|
|
70 |
st.header("Most busy day")
|
71 |
busy_day=helper.week_activity_map(selected_user, df_new)
|
72 |
fig,ax=plt.subplots()
|
73 |
+
ax.bar(busy_day.index,busy_day.values,color=('violet','indigo','blue','green','yellow','orange','red'))
|
74 |
plt.xticks(rotation='vertical')
|
75 |
st.pyplot(fig)
|
76 |
with col2:
|
77 |
st.header("Most busy Month")
|
78 |
busy_day = helper.month_activity_map(selected_user, df_new)
|
79 |
fig, ax = plt.subplots()
|
80 |
+
ax.bar(busy_day.index, busy_day.values,color=('indigo','blue','green','red'))
|
81 |
plt.xticks(rotation='vertical')
|
82 |
st.pyplot(fig)
|
83 |
|
84 |
+
st.title("Weekly Activity HeatMap")
|
85 |
Activity_heatmap=helper.activity_heatmap(selected_user,df_new)
|
86 |
fig,ax=plt.subplots()
|
87 |
+
ax=sns.heatmap(Activity_heatmap,cmap='RdBu',linewidths=1,linecolor='black')
|
88 |
st.pyplot(fig)
|
89 |
|
90 |
if selected_user == "Group analysis":
|
|
|
94 |
col1,col2=st.columns(2)
|
95 |
|
96 |
with col1:
|
97 |
+
ax.bar(x.index, x.values,color=('blue','red','pink','orange','green'))
|
98 |
plt.xticks(rotation='vertical')
|
99 |
st.pyplot(fig)
|
100 |
with col2:
|
|
|
129 |
fig,ax=plt.subplots()
|
130 |
ax.barh(most_common_df[0],most_common_df[1])
|
131 |
st.pyplot(fig)
|
132 |
+
st.dataframe(most_common_df.style.set_properties(**{"background-color": "black", "color": "lawngreen"}))
|
133 |
|
134 |
emoji_df=helper.emoji_helper(selected_user,df_new)
|
135 |
st.title("Emoji Analysis")
|
136 |
+
st.dataframe(emoji_df.style.set_properties(**{"background-color": "black", "color": "lawngreen"}))
|
137 |
|
138 |
|
139 |
st.title("Sentiment Analysis")
|