Spaces:
Sleeping
Sleeping
Added support for AM and PM time formats
Browse files
script.py
CHANGED
@@ -308,8 +308,8 @@ def WhatsappAnalysis(df,nombregrupo,savefigs=False,directory=''):
|
|
308 |
st.pyplot(plt.gcf())
|
309 |
|
310 |
# Assuming 'Time' is in the format 'HH:MM:SS'. If not, adjust the format accordingly.
|
311 |
-
dfFilter['Activation_Time'] = pd.to_datetime(dfFilter['Time'], format='%H:%M').dt.hour
|
312 |
-
|
313 |
# Plot a histogram of message activation times
|
314 |
plt.figure(figsize=(10, 6))
|
315 |
plt.hist(dfFilter['Activation_Time'], bins=24, edgecolor='black', alpha=0.7)
|
|
|
308 |
st.pyplot(plt.gcf())
|
309 |
|
310 |
# Assuming 'Time' is in the format 'HH:MM:SS'. If not, adjust the format accordingly.
|
311 |
+
#dfFilter['Activation_Time'] = pd.to_datetime(dfFilter['Time'], format='%H:%M').dt.hour
|
312 |
+
dfFilter['Activation_Time'] = pd.to_datetime(dfFilter['Time'], format='mixed').dt.hour
|
313 |
# Plot a histogram of message activation times
|
314 |
plt.figure(figsize=(10, 6))
|
315 |
plt.hist(dfFilter['Activation_Time'], bins=24, edgecolor='black', alpha=0.7)
|