<jupyter_start><jupyter_text>Data summary<jupyter_code>import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
# upload preprocessed data 
df = pd.read_csv('data/data_clean.csv', index_col=0, sep= ',', header=0)
df['date'] = df.customer_id.str[0:10]
df.tail()<jupyter_output><empty_output><jupyter_text>total number of customers:<jupyter_code># unique customers per week of day
df.groupby('date')['customer_id'].nunique()<jupyter_output><empty_output><jupyter_text>total number of customers in each section:<jupyter_code># including several visits of one customer to a section
df_group = df.groupby(['date','location'])[['customer_id']].nunique()
df_group.unstack()
df_group.unstack().reset_index()
# aggregate:
s= df.groupby('location')['customer_id'].nunique()
s
# remove checkout
s = s.iloc[1:]
# calculate average
s = s/5
unique_cus_count_by_loc_plot=sns.barplot(s.index, s) 
plt.title('Average customer count per day in supermarket sections')

# with matplotlib:
# df.groupby('location')[['customer_no']].count().plot.bar()<jupyter_output>/usr/local/lib/python3.8/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  warnings.warn(
{'fraction_non_alphanumeric': 0.12968299711815562, 'fraction_numerical': 0.010086455331412104, 'mean_word_length': 7.075581395348837, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '265011', 'license': 'MIT', 'n_tokens_mistral': 473, 'n_tokens_neox': 461, 'n_words': 117, 'path': '.ipynb_checkpoints/01_data_summary-checkpoint.ipynb', 'repo_name': 'mscschliemann/customer_simulation', 'size': '1388'}