Which products sell most, and where do orders get stuck? Descriptive statistics summarize observed data so you can see its typical values, variation, and unusual cases. They are part of descriptive analytics: the broader work of examining business performance through summaries, comparisons, and charts. They describe what the records show; they do not, by themselves, explain why a pattern occurred. section 3.3 section 3.3.4
Start with the data you have, then choose summaries that fit the question:
- Inspect a pandas DataFrame with head(), info(), and describe() to check its columns, non-null counts, data types, and numerical summaries. Use value_counts() for category frequencies. Some checks overlap, so choose what makes your inspection clear rather than running every command mechanically. section 2.3
- After preparing the relevant records, summarize variables such as revenue or review scores. Means, medians, modes, standard deviations, and percentiles offer different views of the data; charts help make patterns visible. section 3.2 section 3.3
- Compare groups that matter to the decision—such as regions, product categories, or sellers—using counts, cross-tabulations, and visualizations. section 3.1 section 3.2
Where are orders getting stuck?
To compare order statuses by product category, merge the relevant order, item, and product records; group by status and category; and count the records. A table with thousands of rows is hard to scan, so ask an AI assistant which visualization would help. A stacked bar chart can show status counts across categories. Then inspect the underlying results: orders marked approved but apparently never shipped are a lead for investigation, not proof of what caused the delay. A later regression analysis can address a different question about delivery times. section 3.3.4
import pandas as pd
import matplotlib.pyplot as plt
# Pivot the DataFrame for the stacked bar chart
status_pivot =
status_distribution_sorted.pivot_table(
index='product_category_name_english',
columns='order_status',
values='count',
aggfunc='sum',
fill_value=0)
# Plot the stacked bar chart
plt.figure(figsize=(20, 10))
status_pivot.plot(kind='bar', stacked=True, figsize=(20, 10))
plt.xticks(rotation=90, fontsize=10)
plt.yticks(fontsize=12)
plt.xlabel('Product Category', fontsize=12)
plt.ylabel('Count of Orders', fontsize=12)
plt.title('Order Status Distribution by Product Category', fontsize=14)
plt.legend(title='Order Status', title_fontsize=12, fontsize=10,
loc='upper right')
plt.tight_layout()
plt.show()
This pandas and Matplotlib workflow pivots grouped status counts and plots a stacked bar chart by product category. Check that the displayed counts answer your question before interpreting the picture. section 3.3.4
Treat AI-generated questions and code as proposals to test. Confirm that the data has been cleaned and joined for the intended comparison, run the code, and look back at the resulting records when something seems surprising. Descriptive findings can guide business decisions and identify questions worth more advanced analysis, but a useful protocol leaves room to revise the plan as the data reveals new issues. section 3.0 section 3.2 section 3.3.4





