I have records such as:
\begin{array}{} \hline \textrm{2024-07-27 21:52:39} \\ \textrm{2024-07-27 21:54:15} \\ \textrm{...} \\ \textrm{2024-07-28 21:58:44} \\ \textrm{2024-07-28 22:01:15} \\ \textrm{...} \\ \textrm{...} \\ \hline \end{array}
And I want to compare the frequency of these records on weekdays vs weekends.
Here is my approach:
- Set an interval - for now 15 minutes and count records in these intervals
- Make two groups a) weekdays, b) weekends
- Resulting data look like:
\begin{array}{c} \hline interval & count \\ \hline \textrm{00:00:00} & 3450 \\ \textrm{00:15:00} & 2144 \\ \textrm{...} \\ \textrm{23:45:00} & 4712 \\ \hline \end{array}
for both weekdays and weekends
Now my questions are:
- Should I "normalize" the data, eg. divide the count by 5 for weekdays and by 2 for weekends because right now the gathered data is over different number of days? Or maybe the total number of different days (I always have a whole day) so for example if it was from Tuesday to Sunday only, then I would divide it by 4 (total number of weekdays) and 2 (total number of weekend days)?
- I was recommended to use two-sample Kolmogorov-Smirnov Test to find out if the distributions are the same, so is it correct to use as follows?:
weekdays = [3450, 2144, ..., 4712]
weekends = [2147, 1544, ..., 3894]
_, p_value = scipy.stats.ks_2samp(weekends, weekdays)
if p_value < 0.05:
print("The distributions on weekdays and weekends are not the same.")
else:
print("The distributions are the same")
```