<jupyter_start><jupyter_text>I use the CRISP-DM process of data science in this notebook Business Understanding In this notebook, I will show the thought process and how we came up with the question: "What is the week to week order count of the top 10 highest ordering shops? what apparent observations can be viewed from it that can help the business team?" and the answer to it<jupyter_code>import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import datetime<jupyter_output><empty_output><jupyter_text>Data Understanding<jupyter_code>df = pd.read_csv('./anonymized/Orders-Grid view.csv')
df.head()
df.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 5189 entries, 0 to 5188
Data columns (total 15 columns):
 #   Column              Non-Null Count  Dtype  
---  ------              --------------  -----  
 0   Order ID            4582 non-null   float64
 1   Order Date          5189 non-null   object 
 2   Shop                5189 non-null   object 
 3   Pick Up Emirate     5189 non-null   object 
 4   Drop Off Emirate    5179 non-null   object 
 5   Drop Off Area       4498 non-null   object 
 6   Delivery Company    5189 non-null   object 
 7   Status              5189 non-null   object 
 8   COD                 1475 non-null   object 
 9   Delivery Cost       4202 non-null   object 
 10  Charge to Customer  4278 non-null   object 
 11  Category            4523 non-null   object 
 12  Delivery Route      5189 non-null   object 
 13  Month - Formula     5189 non-null   object 
 14  Month               5189 non-null   object 
dtypes: float64(1), object(14)
memory usage: 608.2+ KB<jupyter_text>Prep Data<jupyter_code>#fixing the data type of Order Date
df['Order Date']= pd.to_datetime(df['Order Date'],format='%d/%m/%Y', errors='raise') 
df['Shop'].value_counts() #trying to see numerically the most transacting customers<jupyter_output><empty_output><jupyter_text>ModelThere is no machine learning model in this type of Data Analysis  ResultsHere we view the results to our quesiton by visualizing the bar plots of the weekly order transaction of the 10 top shops<jupyter_code>rc={'axes.labelsize': 32, 'font.size': 13, 'font.weight':'bold', 'legend.fontsize': 32.0, 'axes.titlesize': 32, "figure.figsize": (20, 14)}
sns.set_context(rc)


top_ordering_shops_names = df[df['Status'] == 'Delivered']['Shop'].value_counts().index[:10]

i = 0


for shop in top_ordering_shops_names:
    shop_weekly_counts = df[df['Shop'] == shop].groupby(pd.Grouper(key='Order Date',freq='W'))['Shop'].value_counts()
    shop_weekly_counts = shop_weekly_counts.unstack()
    
    
    plt.figure(i)
    i= i+1
    
    g1 = sns.barplot(x = shop_weekly_counts.index.strftime('%d/%m'), y = shop_weekly_counts.values[:,0] , color = "blue")
    g1.set_title(shop)
    g1.set(xlabel='Week Ending on', ylabel='No. Orders')
    g1.set(ylim=(0, 150))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10531732418524871, 'fraction_numerical': 0.045283018867924525, 'mean_word_length': 3.201729106628242, 'pattern_counts': {'":': 1, '<': 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': '616312', 'license': 'FTL', 'n_tokens_mistral': 1050, 'n_tokens_neox': 931, 'n_words': 294, 'path': '2. Top Ordering Shops.ipynb', 'repo_name': 'khalidalawar1/WaslaNowDA', 'size': '2915'}