Tool: Gemini (web, Google Workspace account), temporary chat, Thinking Saved at: 2026-10-18T17:33:10Z Attached file: sales-jan-jun-2026.csv --- Prompt --- The attached file is our sales export for January to June 2026. Before any analysis, describe this data: number of rows, each column and its type, empty cells, duplicate rows and values that look wrong. Then answer: 1. What was total revenue for each region in Q1 (January to March)? 2. Which product had the highest total revenue over the six months, and how much? 3. By what percentage did total revenue change from March to April? For every number you report, show the formula or code that produced it. If a number needs an assumption, state it. --- Reply, as copied with the site's Copy button --- ```python import os import pandas as pd import numpy as np # Find the file files = os.listdir('.') print("Files:", files) for f in files: if 'sales' in f.lower() or f.endswith('.csv'): print("Found file:", f) ``` ```text Files: ['sales-jan-jun-2026.csv'] Found file: sales-jan-jun-2026.csv ``` ```python # Inspect the CSV with open('sales-jan-jun-2026.csv', 'r') as f: first_lines = [f.readline() for _ in range(15)] print("First lines:") for line in first_lines: print(line.strip()) df_raw = pd.read_csv('sales-jan-jun-2026.csv') print(" DataFrame Info:") print(df_raw.info()) print(" DataFrame Shape:", df_raw.shape) print(" Head:") print(df_raw.head(10)) print(" Tail:") print(df_raw.tail(10)) ``` ```text First lines: order_id,order_date,region,product,units,unit_price,revenue SO-1029,2026-01-02,West,Monitor arm,9,89,801.00 SO-1040,2026-01-02,North,Keyboard,6,59,354.00 SO-1006,2026-01-03,South,Keyboard,4,59,236.00 SO-1006,2026-01-03,South,Keyboard,4,59,236.00 SO-1013,2026-01-03,South,Monitor arm,9,89,801.00 SO-1017,2026-01-05,East,Keyboard,2,59,118.00 SO-1024,2026-01-06,West,Keyboard,8,59,472.00 SO-1020,2026-01-07,North,Desk lamp,10,39,390.00 SO-1025,2026-01-07,West,Keyboard,5,59,295.00 SO-1005,2026-01-08,North,Office chair,11,249,2739.00 SO-1027,2026-01-08,East,Office chair,1,249,249.00 SO-1032,2026-01-08,North,Office chair,3,249,747.00 SO-1004,2026-01-09,North,Keyboard,3,59,177.00 SO-1037,2026-01-09,West,Monitor arm,6,89,534.00 DataFrame Info: RangeIndex: 244 entries, 0 to 243 Data columns (total 7 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 order_id 244 non-null object 1 order_date 244 non-null object 2 region 244 non-null object 3 product 244 non-null object 4 units 244 non-null int64 5 unit_price 244 non-null int64 6 revenue 244 non-null object dtypes: int64(2), object(5) memory usage: 13.5+ KB None DataFrame Shape: (244, 7) Head: order_id order_date region product units unit_price revenue 0 SO-1029 2026-01-02 West Monitor arm 9 89 801.00 1 SO-1040 2026-01-02 North Keyboard 6 59 354.00 2 SO-1006 2026-01-03 South Keyboard 4 59 236.00 3 SO-1006 2026-01-03 South Keyboard 4 59 236.00 4 SO-1013 2026-01-03 South Monitor arm 9 89 801.00 5 SO-1017 2026-01-05 East Keyboard 2 59 118.00 6 SO-1024 2026-01-06 West Keyboard 8 59 472.00 7 SO-1020 2026-01-07 North Desk lamp 10 39 390.00 8 SO-1025 2026-01-07 West Keyboard 5 59 295.00 9 SO-1005 2026-01-08 North Office chair 11 249 2739.00 Tail: order_id order_date region product units unit_price revenue 234 SO-1208 2026-06-19 North Desk lamp 1 39 39.00 235 SO-1227 2026-06-19 South Standing desk 9 499 4491.00 236 SO-1212 2026-06-22 North Monitor arm 11 89 979.00 237 SO-1221 2026-06-22 West Desk lamp 8 39 312.00 238 SO-1226 2026-06-22 North Office chair 7 249 1743.00 239 SO-1213 2026-06-23 East Monitor arm 10 89 890.00 240 SO-1207 2026-06-25 East Standing desk 3 499 1497.00 241 SO-1230 2026-06-25 South Office chair 12 249 2988.00 242 SO-1235 2026-06-26 North Keyboard 7 59 413.00 243 SO-1220 2026-06-28 East Standing desk 7 499 3493.00 ``` ```python # Check empty cells print("Empty cells (isna):") print(df_raw.isna().sum()) # Check empty strings or whitespace for col in df_raw.columns: if df_raw[col].dtype == 'object': empty_str = df_raw[col].str.strip().eq('').sum() print(f"Col {col} empty strings: {empty_str}") # Check duplicates print(" Exact duplicate rows count:", df_raw.duplicated().sum()) print("Exact duplicate rows:") print(df_raw[df_raw.duplicated(keep=False)]) # Check order_id duplicates print(" Duplicate order_ids count:", df_raw['order_id'].duplicated().sum()) if df_raw['order_id'].duplicated().sum() > 0: print(df_raw[df_raw['order_id'].duplicated(keep=False)].sort_values('order_id')) ``` ```text Empty cells (isna): order_id 0 order_date 0 region 0 product 0 units 0 unit_price 0 revenue 0 dtype: int64 Col order_id empty strings: 0 Col order_date empty strings: 0 Col region empty strings: 0 Col product empty strings: 0 Col revenue empty strings: 0 Exact duplicate rows count: 4 Exact duplicate rows: order_id order_date region product units unit_price revenue 2 SO-1006 2026-01-03 South Keyboard 4 59 236.00 3 SO-1006 2026-01-03 South Keyboard 4 59 236.00 81 SO-1095 2026-03-01 East Desk lamp 3 39 117.00 82 SO-1095 2026-03-01 East Desk lamp 3 39 117.00 124 SO-1123 2026-04-03 West Keyboard 12 59 708.00 125 SO-1123 2026-04-03 West Keyboard 12 59 708.00 128 SO-1146 2026-04-04 North Desk lamp 5 39 195.00 129 SO-1146 2026-04-04 North Desk lamp 5 39 195.00 Duplicate order_ids count: 4 order_id order_date region product units unit_price revenue 2 SO-1006 2026-01-03 South Keyboard 4 59 236.00 3 SO-1006 2026-01-03 South Keyboard 4 59 236.00 81 SO-1095 2026-03-01 East Desk lamp 3 39 117.00 82 SO-1095 2026-03-01 East Desk lamp 3 39 117.00 124 SO-1123 2026-04-03 West Keyboard 12 59 708.00 125 SO-1123 2026-04-03 West Keyboard 12 59 708.00 128 SO-1146 2026-04-04 North Desk lamp 5 39 195.00 129 SO-1146 2026-04-04 North Desk lamp 5 39 195.00 ``` ```python # Check why revenue is object non_numeric_revenue = [] for idx, val in df_raw['revenue'].items(): try: float(val) except Exception as e: non_numeric_revenue.append((idx, val, str(e))) print("Non-numeric revenue count:", len(non_numeric_revenue)) for item in non_numeric_revenue: print(item) print("Row data: ", df_raw.iloc[item[0]]) ``` ```text Non-numeric revenue count: 1 (84, '1,245.00', "could not convert string to float: '1,245.00'") Row data: order_id SO-1110 order_date 2026-03-01 region North product Office chair units 5 unit_price 249 revenue 1,245.00 Name: 84, dtype: object ``` ```python # Clean revenue df = df_raw.copy() df['revenue_cleaned'] = df['revenue'].astype(str).str.replace(',', '').astype(float) # Check calculated revenue vs stated revenue df['expected_revenue'] = df['units'] * df['unit_price'] df['revenue_diff'] = df['revenue_cleaned'] - df['expected_revenue'] mismatches = df[df['revenue_diff'] != 0] print(f"Revenue mismatches count: {len(mismatches)}") if len(mismatches) > 0: print(mismatches[['order_id', 'order_date', 'product', 'units', 'unit_price', 'revenue', 'revenue_cleaned', 'expected_revenue', 'revenue_diff']]) # Check product and unit_price consistency print(" Product and unit_price pairs:") print(df.groupby(['product', 'unit_price']).size()) # Check unique regions print(" Unique regions:") print(df['region'].value_counts()) # Check unique products print(" Unique products:") print(df['product'].value_counts()) # Check dates print(" Order dates range:") print("Min date:", df['order_date'].min(), "Max date:", df['order_date'].max()) try: df['parsed_date'] = pd.to_datetime(df['order_date'], format='%Y-%m-%d') print("All dates parsed successfully!") except Exception as e: print("Date parse error:", e) # Check units range print(" Units describe:") print(df['units'].describe()) # Check unit_price describe print(" Unit price describe:") print(df['unit_price'].describe()) ``` ```text Revenue mismatches count: 0 Product and unit_price pairs: product unit_price Desk lamp 39 43 Keyboard 59 52 Monitor arm 89 46 Office chair 249 65 Standing desk 499 38 dtype: int64 Unique regions: region North 72 West 66 South 54 East 51 Nort 1 Name: count, dtype: int64 Unique products: product Office chair 65 Keyboard 52 Monitor arm 46 Desk lamp 43 Standing desk 38 Name: count, dtype: int64 Order dates range: Min date: 2026-01-02 Max date: 2026-06-28 All dates parsed successfully! Units describe: count 244.000000 mean 6.000000 std 3.437867 min 1.000000 25% 3.000000 50% 6.000000 75% 9.000000 max 12.000000 Name: units, dtype: float64 Unit price describe: count 244.000000 mean 180.270492 std 159.390637 min 39.000000 25% 59.000000 50% 89.000000 75% 249.000000 max 499.000000 Name: unit_price, dtype: float64 ``` ```python print(df[df['region'] == 'Nort']) ``` ```text order_id order_date region product units unit_price revenue revenue_cleaned expected_revenue revenue_diff parsed_date 43 SO-1047 2026-02-02 Nort Keyboard 12 59 708.00 708.0 708 0.0 2026-02-02 ``` ```python # Let's inspect the effect of duplicates and 'Nort' on: # Q1: Jan 1 to Mar 31 # Product highest revenue over 6 months # March to April revenue change df_raw_calc = df.copy() # Raw calculation (keeping duplicates, but cleaned comma for float) df_raw_calc['month'] = df_raw_calc['parsed_date'].dt.month df_raw_calc['quarter'] = df_raw_calc['parsed_date'].dt.quarter print("=== RAW (Duplicates Kept) ===") # Q1 revenue by region (with Nort kept) q1_raw_with_nort = df_raw_calc[df_raw_calc['quarter'] == 1].groupby('region')['revenue_cleaned'].sum() print(" Q1 by region (raw, 'Nort' separate):") print(q1_raw_with_nort) # Q1 revenue by region (with Nort -> North) df_raw_calc_nort_fixed = df_raw_calc.copy() df_raw_calc_nort_fixed['region'] = df_raw_calc_nort_fixed['region'].replace({'Nort': 'North'}) q1_raw_nort_fixed = df_raw_calc_nort_fixed[df_raw_calc_nort_fixed['quarter'] == 1].groupby('region')['revenue_cleaned'].sum() print(" Q1 by region (raw, 'Nort' fixed to 'North'):") print(q1_raw_nort_fixed) # Top product over 6 months (raw) prod_raw = df_raw_calc.groupby('product')['revenue_cleaned'].sum().sort_values(ascending=False) print(" Product revenue over 6 months (raw):") print(prod_raw) # March vs April revenue change (raw) mar_rev_raw = df_raw_calc[df_raw_calc['month'] == 3]['revenue_cleaned'].sum() apr_rev_raw = df_raw_calc[df_raw_calc['month'] == 4]['revenue_cleaned'].sum() pct_change_raw = ((apr_rev_raw - mar_rev_raw) / mar_rev_raw) * 100 print(f" March raw: {mar_rev_raw:.2f}, April raw: {apr_rev_raw:.2f}, Pct change raw: {pct_change_raw:.4f}%") print(" === CLEANED (Deduplicated & 'Nort' -> 'North') ===") df_clean = df_raw_calc.drop_duplicates(subset=df_raw.columns.tolist()).copy() df_clean['region'] = df_clean['region'].replace({'Nort': 'North'}) q1_clean = df_clean[df_clean['quarter'] == 1].groupby('region')['revenue_cleaned'].sum() print(" Q1 by region (cleaned):") print(q1_clean) prod_clean = df_clean.groupby('product')['revenue_cleaned'].sum().sort_values(ascending=False) print(" Product revenue over 6 months (cleaned):") print(prod_clean) mar_rev_clean = df_clean[df_clean['month'] == 3]['revenue_cleaned'].sum() apr_rev_clean = df_clean[df_clean['month'] == 4]['revenue_cleaned'].sum() pct_change_clean = ((apr_rev_clean - mar_rev_clean) / mar_rev_clean) * 100 print(f" March clean: {mar_rev_clean:.2f}, April clean: {apr_rev_clean:.2f}, Pct change clean: {pct_change_clean:.4f}%") ``` ```text === RAW (Duplicates Kept) === Q1 by region (raw, 'Nort' separate): region East 28280.0 Nort 708.0 North 35679.0 South 23565.0 West 31594.0 Name: revenue_cleaned, dtype: float64 Q1 by region (raw, 'Nort' fixed to 'North'): region East 28280.0 North 36387.0 South 23565.0 West 31594.0 Name: revenue_cleaned, dtype: float64 Product revenue over 6 months (raw): product Standing desk 107784.0 Office chair 91881.0 Monitor arm 23941.0 Keyboard 22243.0 Desk lamp 9087.0 Name: revenue_cleaned, dtype: float64 March raw: 50825.00, April raw: 43969.00, Pct change raw: -13.4894% === CLEANED (Deduplicated & 'Nort' -> 'North') === Q1 by region (cleaned): region East 28163.0 North 36387.0 South 23329.0 West 31594.0 Name: revenue_cleaned, dtype: float64 Product revenue over 6 months (cleaned): product Standing desk 107784.0 Office chair 91881.0 Monitor arm 23941.0 Keyboard 21299.0 Desk lamp 8775.0 Name: revenue_cleaned, dtype: float64 March clean: 50708.00, April clean: 43066.00, Pct change clean: -15.0706% ``` ```python print(df_raw_calc['month'].value_counts().sort_index()) print(" Revenue by month (raw):") print(df_raw_calc.groupby('month')['revenue_cleaned'].sum()) print(" Revenue by month (cleaned):") print(df_clean.groupby('month')['revenue_cleaned'].sum()) ``` ```text month 1 41 2 40 3 41 4 42 5 40 6 40 Name: count, dtype: int64 Revenue by month (raw): month 1 29058.0 2 39943.0 3 50825.0 4 43969.0 5 43225.0 6 47916.0 Name: revenue_cleaned, dtype: float64 Revenue by month (cleaned): month 1 28822.0 2 39943.0 3 50708.0 4 43066.0 5 43225.0 6 47916.0 Name: revenue_cleaned, dtype: float64 ``` ```python # Check string whitespace across all string columns for col in ['order_id', 'order_date', 'region', 'product', 'revenue']: has_leading_trailing = df_raw[col].astype(str).apply(lambda x: x != x.strip()).any() print(f"Col {col} has leading/trailing whitespace: {has_leading_trailing}") # Check order_id pattern import re order_id_patterns = df_raw['order_id'].apply(lambda x: bool(re.match(r'^SO-\d{4}$', x))) print(f"All order_ids match pattern SO-XXXX: {order_id_patterns.all()}") # Check if there are any duplicate order_ids that have DIFFERENT rows order_counts = df_raw['order_id'].value_counts() multi_orders = order_counts[order_counts > 1].index.tolist() for oid in multi_orders: print(df_raw[df_raw['order_id'] == oid]) ``` ```text Col order_id has leading/trailing whitespace: False Col order_date has leading/trailing whitespace: False Col region has leading/trailing whitespace: False Col product has leading/trailing whitespace: False Col revenue has leading/trailing whitespace: False All order_ids match pattern SO-XXXX: True order_id order_date region product units unit_price revenue 124 SO-1123 2026-04-03 West Keyboard 12 59 708.00 125 SO-1123 2026-04-03 West Keyboard 12 59 708.00 order_id order_date region product units unit_price revenue 2 SO-1006 2026-01-03 South Keyboard 4 59 236.00 3 SO-1006 2026-01-03 South Keyboard 4 59 236.00 order_id order_date region product units unit_price revenue 128 SO-1146 2026-04-04 North Desk lamp 5 39 195.00 129 SO-1146 2026-04-04 North Desk lamp 5 39 195.00 order_id order_date region product units unit_price revenue 81 SO-1095 2026-03-01 East Desk lamp 3 39 117.00 82 SO-1095 2026-03-01 East Desk lamp 3 39 117.00 ``` ```python # Detailed verification script print("--- Q1 Summary Table ---") q1_df = pd.DataFrame({ 'Cleaned (Recommended)': q1_clean, 'Raw (Nort -> North)': q1_raw_nort_fixed, 'Raw (Nort As-Is)': q1_raw_with_nort }).fillna(0) print(q1_df) print(" --- Product Summary Table ---") prod_df = pd.DataFrame({ 'Cleaned (Recommended)': prod_clean, 'Raw': prod_raw }) print(prod_df) print(" --- March to April Table ---") print(f"Cleaned: March={mar_rev_clean}, April={apr_rev_clean}, Diff={apr_rev_clean - mar_rev_clean}, Pct={pct_change_clean:.4f}%") print(f"Raw: March={mar_rev_raw}, April={apr_rev_raw}, Diff={apr_rev_raw - mar_rev_raw}, Pct={pct_change_raw:.4f}%") ``` ```text --- Q1 Summary Table --- Cleaned (Recommended) Raw (Nort -> North) Raw (Nort As-Is) region East 28163.0 28280.0 28280.0 Nort 0.0 0.0 708.0 North 36387.0 36387.0 35679.0 South 23329.0 23565.0 23565.0 West 31594.0 31594.0 31594.0 --- Product Summary Table --- Cleaned (Recommended) Raw product Standing desk 107784.0 107784.0 Office chair 91881.0 91881.0 Monitor arm 23941.0 23941.0 Keyboard 21299.0 22243.0 Desk lamp 8775.0 9087.0 --- March to April Table --- Cleaned: March=50708.0, April=43066.0, Diff=-7642.0, Pct=-15.0706% Raw: March=50825.0, April=43969.0, Diff=-6856.0, Pct=-13.4894% ``` ### Dataset Overview and Data Hygiene Check The dataset contains **244 rows** and **7 columns**, representing sales transactions spanning from January 2, 2026, to June 28, 2026. #### Column Profiles | Column | Raw Pandas Dtype | Intended / Semantic Type | Description & Domain | | --- | --- | --- | --- | | `order_id` | `object` | String (Identifier) | Unique order code matching the format `SO-XXXX` | | `order_date` | `object` | Date (`datetime64[ns]`) | ISO-formatted transaction date (`YYYY-MM-DD`) | | `region` | `object` | Categorical | Geographic sales region | | `product` | `object` | Categorical | Item name (5 distinct products) | | `units` | `int64` | Integer | Order volume (values range from 1 to 12) | | `unit_price` | `int64` | Numeric (Currency) | Price per item (39, 59, 89, 249, 499) | | `revenue` | `object` | Float (`float64`) | Stated order total | #### Missing Values, Duplicates, and Data Anomalies * **Empty Cells:** **0 empty or null values** across all 244 rows and 7 columns. * **Duplicate Rows:** **4 exact duplicate rows** (8 rows involved across 4 duplicate pairs): * Rows 2 & 3: `SO-1006` | `2026-01-03` | South | Keyboard | 4 units | $59 | $236.00 * Rows 81 & 82: `SO-1095` | `2026-03-01` | East | Desk lamp | 3 units | $39 | $117.00 * Rows 124 & 125: `SO-1123` | `2026-04-03` | West | Keyboard | 12 units | $59 | $708.00 * Rows 128 & 129: `SO-1146` | `2026-04-04` | North | Desk lamp | 5 units | $39 | $195.00 * **Values That Look Wrong:** 1. **Region Typo in Row 43 (`order_id` SO-1047, 2026-02-02):** The region is entered as `"Nort"` instead of `"North"`. 2. **String Formatting in Row 84 (`order_id` SO-1110, 2026-03-01):** The revenue is entered with a thousands separator comma (`"1,245.00"`), which forces pandas to treat the entire `revenue` column as an `object` (string) rather than a numeric float. 3. **Revenue Cross-Verification:** For every single record, the stated revenue strictly equals $ ext{units} imes ext{unit\_price}$. --- ### Data Preparation Assumptions To ensure full reproducibility, two sets of numbers are reported: * **Cleaned Data (Recommended Assumption):** Exact duplicate rows are removed (`df.drop_duplicates()`), `"Nort"` is corrected to `"North"`, and commas in the `revenue` field are stripped to parse values as standard floating-point numbers. * **Raw Data (Zero-Correction Baseline):** Duplicates are retained as originally exported, parsing commas solely to enable numeric summation. ```python import pandas as pd # Load raw file df_raw = pd.read_csv("sales-jan-jun-2026.csv") df_raw["revenue_num"] = ( df_raw["revenue"].astype(str).str.replace(",", "").astype(float) ) df_raw["order_date"] = pd.to_datetime(df_raw["order_date"]) # Cleaned dataset (recommended) df_clean = df_raw.drop_duplicates().copy() df_clean["region"] = df_clean["region"].replace({"Nort": "North"}) ``` --- ### 1. Total Revenue for Each Region in Q1 (January to March) **Formula:** $$ ext{Regional Q1 Revenue} = \sum_{\substack{ ext{date} \in [ ext{2026-01-01}, ext{2026-03-31}] \ ext{region} = r}} ext{revenue}$$ **Python Code:** ```python # Cleaned (Recommended) q1_clean = ( df_clean[df_clean["order_date"].dt.quarter == 1] .groupby("region")["revenue_num"] .sum() ) # Raw (Duplicates kept, 'Nort' mapped to 'North') df_raw_nort_fixed = df_raw.copy() df_raw_nort_fixed["region"] = df_raw_nort_fixed["region"].replace( {"Nort": "North"} ) q1_raw_nort_fixed = ( df_raw_nort_fixed[df_raw_nort_fixed["order_date"].dt.quarter == 1] .groupby("region")["revenue_num"] .sum() ) # Raw (Unmodified, 'Nort' kept separate) q1_raw_as_is = ( df_raw[df_raw["order_date"].dt.quarter == 1] .groupby("region")["revenue_num"] .sum() ) ``` | Region | Q1 Revenue (Cleaned — Recommended) | Q1 Revenue (Raw, "Nort" $ ightarrow$ "North") | Q1 Revenue (Raw As-Is) | Impact of Data Cleaning | | --- | --- | --- | --- | --- | | **North** | **$36,387.00** | $36,387.00 | $35,679.00 | Includes row 43 ($708.00 from "Nort") | | **West** | **$31,594.00** | $31,594.00 | $31,594.00 | No duplicate rows in Q1 | | **East** | **$28,163.00** | $28,280.00 | $28,280.00 | Deduplicated row 82 (-$117.00) | | **South** | **$23,329.00** | $23,565.00 | $23,565.00 | Deduplicated row 3 (-$236.00) | | *Nort (Typo)* | — | — | $708.00 | Merged into North | | **Total Q1** | **$119,473.00** | **$119,826.00** | **$119,826.00** | Deduplication removes $353.00 in Q1 | --- ### 2. Highest Total Revenue Product Over the Six Months **Standing desk** generated the highest total revenue over the six months, totaling **$107,784.00**. Because none of the duplicate orders involved Standing desks (duplicates only existed in Keyboards and Desk lamps), this figure is identical in both the cleaned and raw datasets. **Formula:** $$ ext{Product Revenue} = \sum_{ ext{product} = p} ext{revenue}$$ **Python Code:** ```python # Cleaned prod_rev_clean = ( df_clean.groupby("product")["revenue_num"].sum().sort_values(ascending=False) ) top_product_clean = prod_rev_clean.index[0] top_product_revenue_clean = prod_rev_clean.iloc[0] # Raw prod_rev_raw = ( df_raw.groupby("product")["revenue_num"].sum().sort_values(ascending=False) ) ``` | Product Rank | Product | Total Revenue (Cleaned) | Total Revenue (Raw) | Unit Price | Total Units Sold (Cleaned) | | --- | --- | --- | --- | --- | --- | | **1** | **Standing desk** | **$107,784.00** | **$107,784.00** | $499 | 216 | | 2 | Office chair | $91,881.00 | $91,881.00 | $249 | 369 | | 3 | Monitor arm | $23,941.00 | $23,941.00 | $89 | 269 | | 4 | Keyboard | $21,299.00 | $22,243.00 | $59 | 361 | | 5 | Desk lamp | $8,775.00 | $9,087.00 | $39 | 225 | | **Total** | | **$253,680.00** | **$254,936.00** | | **1,440** | --- ### 3. Percentage Change in Total Revenue from March to April **Formula:** $$ ext{Percentage Change} = rac{ ext{Revenue}_{ ext{April}} - ext{Revenue}_{ ext{March}}}{ ext{Revenue}_{ ext{March}}} imes 100$$ **Python Code:** ```python # Cleaned (Recommended) mar_clean = df_clean[df_clean["order_date"].dt.month == 3][ "revenue_num" ].sum() # $50,708.00 apr_clean = df_clean[df_clean["order_date"].dt.month == 4][ "revenue_num" ].sum() # $43,066.00 pct_change_clean = ((apr_clean - mar_clean) / mar_clean) * 100 # Raw (Duplicates kept) mar_raw = df_raw[df_raw["order_date"].dt.month == 3][ "revenue_num" ].sum() # $50,825.00 apr_raw = df_raw[df_raw["order_date"].dt.month == 4][ "revenue_num" ].sum() # $43,969.00 pct_change_raw = ((apr_raw - mar_raw) / mar_raw) * 100 ``` #### Cleaned Data (Recommended) * **March 2026 Revenue:** $50,708.00 * **April 2026 Revenue:** $43,066.00 * **Dollar Change:** $-\$7,642.00$ * **Percentage Change:** $$ rac{43,066.00 - 50,708.00}{50,708.00} imes 100 = rac{-7,642.00}{50,708.00} imes 100 = \mathbf{-15.07\%}$$ Total revenue decreased by **15.07%** (or **-15.07%**). #### Raw Data (Duplicates Kept) * **March 2026 Revenue:** $50,825.00 * **April 2026 Revenue:** $43,969.00 * **Dollar Change:** $-\$6,856.00$ * **Percentage Change:** $$ rac{43,969.00 - 50,825.00}{50,825.00} imes 100 = rac{-6,856.00}{50,825.00} imes 100 = \mathbf{-13.49\%}$$ Total revenue decreased by **13.49%** (or **-13.49%**).