<jupyter_start><jupyter_text>Calculate the total number of customers in each section<jupyter_code>df_l = df.groupby('location')['customer_no']

for i,j in df_l:
    print(i)
    print(j)
df_l.get_group('dairy')
df_l.count().plot.bar();<jupyter_output><empty_output><jupyter_text>Calculate the total number of customers in each section over time<jupyter_code>df1= df.groupby(['weekday','location'])['customer_no'].count()
df1.unstack().plot.bar(stacked= True);<jupyter_output><empty_output><jupyter_text>Display the number of customers at checkout over time<jupyter_code>df2 = df.groupby(['location','hour'])['customer_no'].count().reset_index()
df2
df3 = df.groupby(['weekday','hour'])['customer_no'].count().reset_index()
df3
plt.figure(figsize = (12,12))

plt.subplot(2,1,1)
sns.pointplot(data = df2, x = df2['hour'], y = df2['customer_no'], hue = df2['location'], join = True);

plt.subplot(2,1,2)
sns.pointplot(data = df3, x = df3['hour'], y = df3['customer_no'], hue = df3['weekday'], join = True);<jupyter_output><empty_output><jupyter_text>Calculate the time each customer spent in the market<jupyter_code>df_in = df.sort_values('customer_no').groupby(['customer_no', 'weekday'])['timestamp'].max()
df_out = df.sort_values('customer_no').groupby(['customer_no', 'weekday'])['timestamp'].min()
time_spent = df_in - df_out

time_spentb 
state_list = ["fruit","spices","drinks","dairy","checkout"]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18448637316561844, 'fraction_numerical': 0.016771488469601678, 'mean_word_length': 8.741496598639456, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '191517', 'license': 'MIT', 'n_tokens_mistral': 539, 'n_tokens_neox': 526, 'n_words': 87, 'path': 'Dooodl.ipynb', 'repo_name': 'Amaranga/markov_ki', 'size': '1431'}