{"id":25415395,"url":"https://github.com/dcostachar/pet-store-transactions-analysis","last_synced_at":"2026-04-15T09:31:25.084Z","repository":{"id":277218967,"uuid":"931718338","full_name":"dcostachar/pet-store-transactions-analysis","owner":"dcostachar","description":"An analysis of a pet store's transactions dataset using Python to clean, explore, and visualize key trends in product sales.","archived":false,"fork":false,"pushed_at":"2025-02-12T18:46:56.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-29T07:41:52.461Z","etag":null,"topics":["data-cleaning","data-visualization","exploratory-data-analysis","matplotlib","pandas","python","seaborn"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcostachar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-12T18:35:56.000Z","updated_at":"2025-02-12T18:59:36.000Z","dependencies_parsed_at":"2025-02-14T11:15:39.989Z","dependency_job_id":null,"html_url":"https://github.com/dcostachar/pet-store-transactions-analysis","commit_stats":null,"previous_names":["dcostachar/pet-store-transactions-analysis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dcostachar/pet-store-transactions-analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcostachar%2Fpet-store-transactions-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcostachar%2Fpet-store-transactions-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcostachar%2Fpet-store-transactions-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcostachar%2Fpet-store-transactions-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcostachar","download_url":"https://codeload.github.com/dcostachar/pet-store-transactions-analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcostachar%2Fpet-store-transactions-analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31834502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T07:17:56.427Z","status":"ssl_error","status_checked_at":"2026-04-15T07:17:30.007Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-cleaning","data-visualization","exploratory-data-analysis","matplotlib","pandas","python","seaborn"],"created_at":"2025-02-16T15:34:36.103Z","updated_at":"2026-04-15T09:31:25.054Z","avatar_url":"https://github.com/dcostachar.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pet Store Transactions Analysis: Uncovering Sales Insights with Python\n\nAuthor: Charlene D'Costa \u003cbr /\u003e\nDate: February 10, 2025 \u003cbr /\u003e\nCoursework for the Meta Marketing Analytics Professional Certificate. \u003cbr /\u003e\n\n[Pet Store Transactions Dataset](https://github.com/dcostachar/pet-store-transactions-analysis/blob/main/data/transactions.csv)\n\n# Project Overview\n\n\u003cdetails\u003e\n  \u003csummary\u003eDefining the business problem.\u003c/summary\u003e\n\n\u003cbr /\u003e\n\nFor this project, I used Python to perform data cleaning and exploratory data analysis (EDA) on a fictitious pet store transactions dataset. I began by cleaning the data—handling missing values, removing data anomalies, and dropping columns with excessive nulls. Next, I conducted EDA to uncover product sales trends, analyze the quantity sold by category, and identify both the most popular and the highest-priced categories within different product lines. Finally, I created visualizations, including bar and box plots, to provide stakeholders with actionable insights on top-selling categories and price distributions, informing business decisions about which product lines drive the most revenue and where pricing adjustments might be considered.\n\n\u003c/details\u003e\n\n# Data Cleaning\n\n\u003cdetails\u003e\n  \u003csummary\u003eCleaning the data for analysis. \u003c/summary\u003e \n\n\u003cbr /\u003e\n\nIn this section, I will import and clean the dataset to prepare it for analysis. I will use PyCharm as my integrated development environment (IDE) along with its Jupyter Notebook integration to perform the analysis. Additionally, I import the following libraries, which will be used throughout the project: pandas, matplotlib, and seaborn.\n\n\n```python\n# Importing libraries.\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n# Importing dataset.\ndf = pd.read_csv(\"./data/transactions.csv\")\n```\n\n\n\n\n\u003cdiv\u003e\n\u003cstyle scoped\u003e\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n\u003c/style\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003eDate\u003c/th\u003e\n      \u003cth\u003eOrder_Number\u003c/th\u003e\n      \u003cth\u003eCustomer_ID\u003c/th\u003e\n      \u003cth\u003eProduct_Name\u003c/th\u003e\n      \u003cth\u003eSKU\u003c/th\u003e\n      \u003cth\u003ePrice\u003c/th\u003e\n      \u003cth\u003eSize\u003c/th\u003e\n      \u003cth\u003eQuantity\u003c/th\u003e\n      \u003cth\u003eProduct_Category\u003c/th\u003e\n      \u003cth\u003eProduct_Line\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth\u003e0\u003c/th\u003e\n      \u003ctd\u003e5/22/2021\u003c/td\u003e\n      \u003ctd\u003eSXF-7309-1727-1334\u003c/td\u003e\n      \u003ctd\u003e476582ea-1bba-4289-8775-3fcd8074821c\u003c/td\u003e\n      \u003ctd\u003eFeline Fix Mix\u003c/td\u003e\n      \u003ctd\u003eRKAPY3I1TP\u003c/td\u003e\n      \u003ctd\u003e39.55\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003etreat\u003c/td\u003e\n      \u003ctd\u003ecat\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e1\u003c/th\u003e\n      \u003ctd\u003e5/22/2021\u003c/td\u003e\n      \u003ctd\u003eSXF-7309-1727-1334\u003c/td\u003e\n      \u003ctd\u003e476582ea-1bba-4289-8775-3fcd8074821c\u003c/td\u003e\n      \u003ctd\u003eScratchy Post\u003c/td\u003e\n      \u003ctd\u003eMPH6SCD7UT\u003c/td\u003e\n      \u003ctd\u003e26.95\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e3\u003c/td\u003e\n      \u003ctd\u003etoy\u003c/td\u003e\n      \u003ctd\u003ecat\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2\u003c/th\u003e\n      \u003ctd\u003e5/22/2021\u003c/td\u003e\n      \u003ctd\u003eSXF-7309-1727-1334\u003c/td\u003e\n      \u003ctd\u003e476582ea-1bba-4289-8775-3fcd8074821c\u003c/td\u003e\n      \u003ctd\u003eReddy Beddy\u003c/td\u003e\n      \u003ctd\u003eDJWE1V9LZK\u003c/td\u003e\n      \u003ctd\u003e23.07\u003c/td\u003e\n      \u003ctd\u003elarge\u003c/td\u003e\n      \u003ctd\u003e3\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e3\u003c/th\u003e\n      \u003ctd\u003e3/23/2020\u003c/td\u003e\n      \u003ctd\u003eDG7-5410-5845-1340\u003c/td\u003e\n      \u003ctd\u003e5929a0e9-95a7-4dbf-896e-c11d1988615e\u003c/td\u003e\n      \u003ctd\u003eSnoozer Essentails\u003c/td\u003e\n      \u003ctd\u003eGABWVMEL2R\u003c/td\u003e\n      \u003ctd\u003e28.04\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e3\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e4\u003c/th\u003e\n      \u003ctd\u003e3/23/2020\u003c/td\u003e\n      \u003ctd\u003eDG7-5410-5845-1340\u003c/td\u003e\n      \u003ctd\u003e5929a0e9-95a7-4dbf-896e-c11d1988615e\u003c/td\u003e\n      \u003ctd\u003eReddy Beddy\u003c/td\u003e\n      \u003ctd\u003eKDTMPSBZKZ\u003c/td\u003e\n      \u003ctd\u003e13.84\u003c/td\u003e\n      \u003ctd\u003esmall\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e...\u003c/th\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2898\u003c/th\u003e\n      \u003ctd\u003e10/16/2020\u003c/td\u003e\n      \u003ctd\u003eP8K-8079-0264-6569\u003c/td\u003e\n      \u003ctd\u003e468f40b3-59ca-47fd-9739-c7f19cf48f32\u003c/td\u003e\n      \u003ctd\u003eCat Cave\u003c/td\u003e\n      \u003ctd\u003e058G0P7V60\u003c/td\u003e\n      \u003ctd\u003e29.66\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003ecat\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2899\u003c/th\u003e\n      \u003ctd\u003e10/16/2020\u003c/td\u003e\n      \u003ctd\u003eP8K-8079-0264-6569\u003c/td\u003e\n      \u003ctd\u003e468f40b3-59ca-47fd-9739-c7f19cf48f32\u003c/td\u003e\n      \u003ctd\u003eKitty Climber\u003c/td\u003e\n      \u003ctd\u003eW86BRJ9SSG\u003c/td\u003e\n      \u003ctd\u003e39.32\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003etoy\u003c/td\u003e\n      \u003ctd\u003ecat\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2900\u003c/th\u003e\n      \u003ctd\u003e10/16/2020\u003c/td\u003e\n      \u003ctd\u003eP8K-8079-0264-6569\u003c/td\u003e\n      \u003ctd\u003e468f40b3-59ca-47fd-9739-c7f19cf48f32\u003c/td\u003e\n      \u003ctd\u003eFetch Blaster\u003c/td\u003e\n      \u003ctd\u003eM291KHJ4LW\u003c/td\u003e\n      \u003ctd\u003e29.47\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003etoy\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2901\u003c/th\u003e\n      \u003ctd\u003e10/16/2020\u003c/td\u003e\n      \u003ctd\u003eP8K-8079-0264-6569\u003c/td\u003e\n      \u003ctd\u003e468f40b3-59ca-47fd-9739-c7f19cf48f32\u003c/td\u003e\n      \u003ctd\u003eSnoozer Essentails\u003c/td\u003e\n      \u003ctd\u003eGABWVMEL2R\u003c/td\u003e\n      \u003ctd\u003e28.04\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2902\u003c/th\u003e\n      \u003ctd\u003e12/10/2019\u003c/td\u003e\n      \u003ctd\u003e6ZD-7972-0320-6653\u003c/td\u003e\n      \u003ctd\u003ef2a090b3-ec77-4018-939e-1a18d2b4f4ef\u003c/td\u003e\n      \u003ctd\u003eSnoozer Essentails\u003c/td\u003e\n      \u003ctd\u003eGABWVMEL2R\u003c/td\u003e\n      \u003ctd\u003e28.04\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003e2903 rows × 10 columns\u003c/p\u003e\n\u003c/div\u003e\n\n\n\n\n```python\n# Using df.info() to display a concise summary of the DataFrame, including the index, column names, data types, non-null counts, and memory usage.\ndf.info()\n```\n\n    \u003cclass 'pandas.core.frame.DataFrame'\u003e\n    Index: 2758 entries, 0 to 2902\n    Data columns (total 10 columns):\n     #   Column            Non-Null Count  Dtype  \n    ---  ------            --------------  -----  \n     0   Date              2758 non-null   object \n     1   Order_Number      2758 non-null   object \n     2   Customer_ID       2716 non-null   object \n     3   Product_Name      2758 non-null   object \n     4   SKU               2758 non-null   object \n     5   Price             2758 non-null   float64\n     6   Size              626 non-null    object \n     7   Quantity          2758 non-null   int64  \n     8   Product_Category  2758 non-null   object \n     9   Product_Line      2758 non-null   object \n    dtypes: float64(1), int64(1), object(8)\n    memory usage: 237.0+ KB\n\n\n### Question 1: Remove all rows that are missing either the `Product_Name` or the `Product_Category`.\n\n\n```python\n# Dropping rows where either the 'Product_Name' or the 'Product_Category' column has a missing value.\ndf = df.dropna(subset = ['Product_Name', 'Product_Category'])\n```\n\n\n\n\n\u003cdiv\u003e\n\u003cstyle scoped\u003e\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n\u003c/style\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003eDate\u003c/th\u003e\n      \u003cth\u003eOrder_Number\u003c/th\u003e\n      \u003cth\u003eCustomer_ID\u003c/th\u003e\n      \u003cth\u003eProduct_Name\u003c/th\u003e\n      \u003cth\u003eSKU\u003c/th\u003e\n      \u003cth\u003ePrice\u003c/th\u003e\n      \u003cth\u003eSize\u003c/th\u003e\n      \u003cth\u003eQuantity\u003c/th\u003e\n      \u003cth\u003eProduct_Category\u003c/th\u003e\n      \u003cth\u003eProduct_Line\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth\u003e0\u003c/th\u003e\n      \u003ctd\u003e5/22/2021\u003c/td\u003e\n      \u003ctd\u003eSXF-7309-1727-1334\u003c/td\u003e\n      \u003ctd\u003e476582ea-1bba-4289-8775-3fcd8074821c\u003c/td\u003e\n      \u003ctd\u003eFeline Fix Mix\u003c/td\u003e\n      \u003ctd\u003eRKAPY3I1TP\u003c/td\u003e\n      \u003ctd\u003e39.55\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003etreat\u003c/td\u003e\n      \u003ctd\u003ecat\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e1\u003c/th\u003e\n      \u003ctd\u003e5/22/2021\u003c/td\u003e\n      \u003ctd\u003eSXF-7309-1727-1334\u003c/td\u003e\n      \u003ctd\u003e476582ea-1bba-4289-8775-3fcd8074821c\u003c/td\u003e\n      \u003ctd\u003eScratchy Post\u003c/td\u003e\n      \u003ctd\u003eMPH6SCD7UT\u003c/td\u003e\n      \u003ctd\u003e26.95\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e3\u003c/td\u003e\n      \u003ctd\u003etoy\u003c/td\u003e\n      \u003ctd\u003ecat\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2\u003c/th\u003e\n      \u003ctd\u003e5/22/2021\u003c/td\u003e\n      \u003ctd\u003eSXF-7309-1727-1334\u003c/td\u003e\n      \u003ctd\u003e476582ea-1bba-4289-8775-3fcd8074821c\u003c/td\u003e\n      \u003ctd\u003eReddy Beddy\u003c/td\u003e\n      \u003ctd\u003eDJWE1V9LZK\u003c/td\u003e\n      \u003ctd\u003e23.07\u003c/td\u003e\n      \u003ctd\u003elarge\u003c/td\u003e\n      \u003ctd\u003e3\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e3\u003c/th\u003e\n      \u003ctd\u003e3/23/2020\u003c/td\u003e\n      \u003ctd\u003eDG7-5410-5845-1340\u003c/td\u003e\n      \u003ctd\u003e5929a0e9-95a7-4dbf-896e-c11d1988615e\u003c/td\u003e\n      \u003ctd\u003eSnoozer Essentails\u003c/td\u003e\n      \u003ctd\u003eGABWVMEL2R\u003c/td\u003e\n      \u003ctd\u003e28.04\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e3\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e4\u003c/th\u003e\n      \u003ctd\u003e3/23/2020\u003c/td\u003e\n      \u003ctd\u003eDG7-5410-5845-1340\u003c/td\u003e\n      \u003ctd\u003e5929a0e9-95a7-4dbf-896e-c11d1988615e\u003c/td\u003e\n      \u003ctd\u003eReddy Beddy\u003c/td\u003e\n      \u003ctd\u003eKDTMPSBZKZ\u003c/td\u003e\n      \u003ctd\u003e13.84\u003c/td\u003e\n      \u003ctd\u003esmall\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e...\u003c/th\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2898\u003c/th\u003e\n      \u003ctd\u003e10/16/2020\u003c/td\u003e\n      \u003ctd\u003eP8K-8079-0264-6569\u003c/td\u003e\n      \u003ctd\u003e468f40b3-59ca-47fd-9739-c7f19cf48f32\u003c/td\u003e\n      \u003ctd\u003eCat Cave\u003c/td\u003e\n      \u003ctd\u003e058G0P7V60\u003c/td\u003e\n      \u003ctd\u003e29.66\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003ecat\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2899\u003c/th\u003e\n      \u003ctd\u003e10/16/2020\u003c/td\u003e\n      \u003ctd\u003eP8K-8079-0264-6569\u003c/td\u003e\n      \u003ctd\u003e468f40b3-59ca-47fd-9739-c7f19cf48f32\u003c/td\u003e\n      \u003ctd\u003eKitty Climber\u003c/td\u003e\n      \u003ctd\u003eW86BRJ9SSG\u003c/td\u003e\n      \u003ctd\u003e39.32\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003etoy\u003c/td\u003e\n      \u003ctd\u003ecat\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2900\u003c/th\u003e\n      \u003ctd\u003e10/16/2020\u003c/td\u003e\n      \u003ctd\u003eP8K-8079-0264-6569\u003c/td\u003e\n      \u003ctd\u003e468f40b3-59ca-47fd-9739-c7f19cf48f32\u003c/td\u003e\n      \u003ctd\u003eFetch Blaster\u003c/td\u003e\n      \u003ctd\u003eM291KHJ4LW\u003c/td\u003e\n      \u003ctd\u003e29.47\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003etoy\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2901\u003c/th\u003e\n      \u003ctd\u003e10/16/2020\u003c/td\u003e\n      \u003ctd\u003eP8K-8079-0264-6569\u003c/td\u003e\n      \u003ctd\u003e468f40b3-59ca-47fd-9739-c7f19cf48f32\u003c/td\u003e\n      \u003ctd\u003eSnoozer Essentails\u003c/td\u003e\n      \u003ctd\u003eGABWVMEL2R\u003c/td\u003e\n      \u003ctd\u003e28.04\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2902\u003c/th\u003e\n      \u003ctd\u003e12/10/2019\u003c/td\u003e\n      \u003ctd\u003e6ZD-7972-0320-6653\u003c/td\u003e\n      \u003ctd\u003ef2a090b3-ec77-4018-939e-1a18d2b4f4ef\u003c/td\u003e\n      \u003ctd\u003eSnoozer Essentails\u003c/td\u003e\n      \u003ctd\u003eGABWVMEL2R\u003c/td\u003e\n      \u003ctd\u003e28.04\u003c/td\u003e\n      \u003ctd\u003eNaN\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003e2758 rows × 10 columns\u003c/p\u003e\n\u003c/div\u003e\n\n\n\n### Question 2: Find any clearly \"incorrect\" values in the `Price` column and clean the DataFrame to address those values.\n\n\n```python\n# Based on the earlier output from df.info(), we know that the 'Price' column is numeric (float64).\n# Therefore, instead of checking for non-numeric data, we need to verify that the price values are valid.\n# For example, negative prices are not acceptable.\n\n# Check the minimum and maximum values of the 'Price' column.\n# (A negative minimum indicates an invalid value.)\ndf.Price.min(), df.Price.max()\n\n# Create a mask to retain only rows where 'Price' is greater than 0 and less than 15,000.\n# This filters out any negative prices and any values that are unreasonably high.\nvalid_mask = (df.Price \u003e 0) \u0026 (df.Price \u003c 15000)\n\n# Apply the mask to filter the DataFrame.\ndf = df[valid_mask]\n```\n\n\n\n\n    (np.float64(10.8), np.float64(39.55))\n\n\n\n### Question 3: After you've done the cleaning above, remove any column that has more than 500 missing values.\n\n\n```python\n# From counting the number of missing values in each column, we see that the 'Size' column has over 500 missing values (2222 missing values).\ndf.isna().sum()\n\n# Dropping the 'Size' column from the DataFrame.\ndf = df.drop(columns='Size')\n```\n\n### Question 4: Address the other missing values. You can replace the values or remove them, but whatever method you decide to clean the DataFrame, you should no longer have any missing values.\n\n\n```python\n# Using df.dropna() to remove any remaining rows that contain missing values.\ndf = df.dropna()\n\n# Verifying that all missing values have been removed by counting the missing values in each column. Since there are none, we can move on.\ndf.isna().sum()\n```\n\n\n\n\n    Date                0\n    Order_Number        0\n    Customer_ID         0\n    Product_Name        0\n    SKU                 0\n    Price               0\n    Quantity            0\n    Product_Category    0\n    Product_Line        0\n    dtype: int64\n\n\n\u003c/details\u003e\n\n# Exploratory Data Analysis\n\n\u003cdetails\u003e\n  \u003csummary\u003eUncovering patterns and analyzing relationships between variables. \u003c/summary\u003e\n\n### Question 5: Create a `Subtotal` column by multiplying the `Price` and `Quantity` values.\n\n\n```python\n# Creating 'Subtotal' column\ndf['Subtotal'] = df.Price * df.Quantity\n```\n\n\n\n\n\u003cdiv\u003e\n\u003cstyle scoped\u003e\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n\u003c/style\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003eDate\u003c/th\u003e\n      \u003cth\u003eOrder_Number\u003c/th\u003e\n      \u003cth\u003eCustomer_ID\u003c/th\u003e\n      \u003cth\u003eProduct_Name\u003c/th\u003e\n      \u003cth\u003eSKU\u003c/th\u003e\n      \u003cth\u003ePrice\u003c/th\u003e\n      \u003cth\u003eQuantity\u003c/th\u003e\n      \u003cth\u003eProduct_Category\u003c/th\u003e\n      \u003cth\u003eProduct_Line\u003c/th\u003e\n      \u003cth\u003eSubtotal\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth\u003e0\u003c/th\u003e\n      \u003ctd\u003e5/22/2021\u003c/td\u003e\n      \u003ctd\u003eSXF-7309-1727-1334\u003c/td\u003e\n      \u003ctd\u003e476582ea-1bba-4289-8775-3fcd8074821c\u003c/td\u003e\n      \u003ctd\u003eFeline Fix Mix\u003c/td\u003e\n      \u003ctd\u003eRKAPY3I1TP\u003c/td\u003e\n      \u003ctd\u003e39.55\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003etreat\u003c/td\u003e\n      \u003ctd\u003ecat\u003c/td\u003e\n      \u003ctd\u003e39.55\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e1\u003c/th\u003e\n      \u003ctd\u003e5/22/2021\u003c/td\u003e\n      \u003ctd\u003eSXF-7309-1727-1334\u003c/td\u003e\n      \u003ctd\u003e476582ea-1bba-4289-8775-3fcd8074821c\u003c/td\u003e\n      \u003ctd\u003eScratchy Post\u003c/td\u003e\n      \u003ctd\u003eMPH6SCD7UT\u003c/td\u003e\n      \u003ctd\u003e26.95\u003c/td\u003e\n      \u003ctd\u003e3\u003c/td\u003e\n      \u003ctd\u003etoy\u003c/td\u003e\n      \u003ctd\u003ecat\u003c/td\u003e\n      \u003ctd\u003e80.85\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2\u003c/th\u003e\n      \u003ctd\u003e5/22/2021\u003c/td\u003e\n      \u003ctd\u003eSXF-7309-1727-1334\u003c/td\u003e\n      \u003ctd\u003e476582ea-1bba-4289-8775-3fcd8074821c\u003c/td\u003e\n      \u003ctd\u003eReddy Beddy\u003c/td\u003e\n      \u003ctd\u003eDJWE1V9LZK\u003c/td\u003e\n      \u003ctd\u003e23.07\u003c/td\u003e\n      \u003ctd\u003e3\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n      \u003ctd\u003e69.21\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e3\u003c/th\u003e\n      \u003ctd\u003e3/23/2020\u003c/td\u003e\n      \u003ctd\u003eDG7-5410-5845-1340\u003c/td\u003e\n      \u003ctd\u003e5929a0e9-95a7-4dbf-896e-c11d1988615e\u003c/td\u003e\n      \u003ctd\u003eSnoozer Essentails\u003c/td\u003e\n      \u003ctd\u003eGABWVMEL2R\u003c/td\u003e\n      \u003ctd\u003e28.04\u003c/td\u003e\n      \u003ctd\u003e3\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n      \u003ctd\u003e84.12\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e4\u003c/th\u003e\n      \u003ctd\u003e3/23/2020\u003c/td\u003e\n      \u003ctd\u003eDG7-5410-5845-1340\u003c/td\u003e\n      \u003ctd\u003e5929a0e9-95a7-4dbf-896e-c11d1988615e\u003c/td\u003e\n      \u003ctd\u003eReddy Beddy\u003c/td\u003e\n      \u003ctd\u003eKDTMPSBZKZ\u003c/td\u003e\n      \u003ctd\u003e13.84\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n      \u003ctd\u003e13.84\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e...\u003c/th\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n      \u003ctd\u003e...\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2898\u003c/th\u003e\n      \u003ctd\u003e10/16/2020\u003c/td\u003e\n      \u003ctd\u003eP8K-8079-0264-6569\u003c/td\u003e\n      \u003ctd\u003e468f40b3-59ca-47fd-9739-c7f19cf48f32\u003c/td\u003e\n      \u003ctd\u003eCat Cave\u003c/td\u003e\n      \u003ctd\u003e058G0P7V60\u003c/td\u003e\n      \u003ctd\u003e29.66\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003ecat\u003c/td\u003e\n      \u003ctd\u003e29.66\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2899\u003c/th\u003e\n      \u003ctd\u003e10/16/2020\u003c/td\u003e\n      \u003ctd\u003eP8K-8079-0264-6569\u003c/td\u003e\n      \u003ctd\u003e468f40b3-59ca-47fd-9739-c7f19cf48f32\u003c/td\u003e\n      \u003ctd\u003eKitty Climber\u003c/td\u003e\n      \u003ctd\u003eW86BRJ9SSG\u003c/td\u003e\n      \u003ctd\u003e39.32\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003etoy\u003c/td\u003e\n      \u003ctd\u003ecat\u003c/td\u003e\n      \u003ctd\u003e39.32\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2900\u003c/th\u003e\n      \u003ctd\u003e10/16/2020\u003c/td\u003e\n      \u003ctd\u003eP8K-8079-0264-6569\u003c/td\u003e\n      \u003ctd\u003e468f40b3-59ca-47fd-9739-c7f19cf48f32\u003c/td\u003e\n      \u003ctd\u003eFetch Blaster\u003c/td\u003e\n      \u003ctd\u003eM291KHJ4LW\u003c/td\u003e\n      \u003ctd\u003e29.47\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003etoy\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n      \u003ctd\u003e29.47\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2901\u003c/th\u003e\n      \u003ctd\u003e10/16/2020\u003c/td\u003e\n      \u003ctd\u003eP8K-8079-0264-6569\u003c/td\u003e\n      \u003ctd\u003e468f40b3-59ca-47fd-9739-c7f19cf48f32\u003c/td\u003e\n      \u003ctd\u003eSnoozer Essentails\u003c/td\u003e\n      \u003ctd\u003eGABWVMEL2R\u003c/td\u003e\n      \u003ctd\u003e28.04\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n      \u003ctd\u003e28.04\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2902\u003c/th\u003e\n      \u003ctd\u003e12/10/2019\u003c/td\u003e\n      \u003ctd\u003e6ZD-7972-0320-6653\u003c/td\u003e\n      \u003ctd\u003ef2a090b3-ec77-4018-939e-1a18d2b4f4ef\u003c/td\u003e\n      \u003ctd\u003eSnoozer Essentails\u003c/td\u003e\n      \u003ctd\u003eGABWVMEL2R\u003c/td\u003e\n      \u003ctd\u003e28.04\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003ebedding\u003c/td\u003e\n      \u003ctd\u003edog\u003c/td\u003e\n      \u003ctd\u003e28.04\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003e2714 rows × 10 columns\u003c/p\u003e\n\u003c/div\u003e\n\n\n\n### Question 6: Identify the most common `Product_Category` purchased for each `Product_Line`. Then, assign the name of that category (as a string) to the variables common_category_cat and common_category_dog.\n\n\n```python\n# Grouping the DataFrame by 'Product_Line' and 'Product_Category' and summing the numeric columns (e.g., Quantity) to identify the most purchased item for each Product Line (cat and dog).\ndf.groupby(['Product_Line', 'Product_Category']).sum()\n\n# Based on the aggregated results, assigning the most common product category (i.e., the one with the highest total items sold) for each product line to the respective variables.\ncommon_category_cat = 'treat'\ncommon_category_dog = 'bedding'\n```\n\n\n\n\n\u003cdiv\u003e\n\u003cstyle scoped\u003e\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n\u003c/style\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003eDate\u003c/th\u003e\n      \u003cth\u003eOrder_Number\u003c/th\u003e\n      \u003cth\u003eCustomer_ID\u003c/th\u003e\n      \u003cth\u003eProduct_Name\u003c/th\u003e\n      \u003cth\u003eSKU\u003c/th\u003e\n      \u003cth\u003ePrice\u003c/th\u003e\n      \u003cth\u003eQuantity\u003c/th\u003e\n      \u003cth\u003eSubtotal\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eProduct_Line\u003c/th\u003e\n      \u003cth\u003eProduct_Category\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth rowspan=\"4\" valign=\"top\"\u003ecat\u003c/th\u003e\n      \u003cth\u003ebedding\u003c/th\u003e\n      \u003ctd\u003e9/21/20199/12/20209/14/20198/24/202111/6/20197...\u003c/td\u003e\n      \u003ctd\u003eENT-5271-0660-48509K8-5765-4461-7159G7Y-9331-8...\u003c/td\u003e\n      \u003ctd\u003ed13c8860-67ae-44fb-8827-7afa9b4eec7a5c91c913-6...\u003c/td\u003e\n      \u003ctd\u003eCat CaveSnoozer HammockSnoozer HammockCat Cave...\u003c/td\u003e\n      \u003ctd\u003e058G0P7V60V4B4RNS3ZPV4B4RNS3ZP058G0P7V60058G0P...\u003c/td\u003e\n      \u003ctd\u003e8371.70\u003c/td\u003e\n      \u003ctd\u003e526\u003c/td\u003e\n      \u003ctd\u003e16733.96\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003efood\u003c/th\u003e\n      \u003ctd\u003e6/30/20219/14/20191/27/202010/9/20198/24/20217...\u003c/td\u003e\n      \u003ctd\u003eTCS-6223-7628-2720G7Y-9331-8313-29499FH-9267-0...\u003c/td\u003e\n      \u003ctd\u003eaacbf226-43d2-4b06-987b-5c4224c11b9d5bc15bf9-0...\u003c/td\u003e\n      \u003ctd\u003eYum Fish-DishPurr MixYum Fish-DishPurr MixYum ...\u003c/td\u003e\n      \u003ctd\u003eGZCJZ3ET04O5FYJLBE0HGZCJZ3ET04O5FYJLBE0HGZCJZ3...\u003c/td\u003e\n      \u003ctd\u003e5957.41\u003c/td\u003e\n      \u003ctd\u003e422\u003c/td\u003e\n      \u003ctd\u003e11638.76\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003etoy\u003c/th\u003e\n      \u003ctd\u003e5/22/20215/14/20209/12/20205/30/20219/14/20191...\u003c/td\u003e\n      \u003ctd\u003eSXF-7309-1727-1334VQE-2656-9729-61949K8-5765-4...\u003c/td\u003e\n      \u003ctd\u003e476582ea-1bba-4289-8775-3fcd8074821c041686b3-e...\u003c/td\u003e\n      \u003ctd\u003eScratchy PostFoozy MouseFoozy MouseFoozy Mouse...\u003c/td\u003e\n      \u003ctd\u003eMPH6SCD7UT8PYSMLYINS8PYSMLYINS8PYSMLYINS8PYSML...\u003c/td\u003e\n      \u003ctd\u003e10116.60\u003c/td\u003e\n      \u003ctd\u003e851\u003c/td\u003e\n      \u003ctd\u003e19651.79\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003etreat\u003c/th\u003e\n      \u003ctd\u003e5/22/20211/5/20205/14/202011/2/202012/2/20191/...\u003c/td\u003e\n      \u003ctd\u003eSXF-7309-1727-133414C-6286-0019-4676VQE-2656-9...\u003c/td\u003e\n      \u003ctd\u003e476582ea-1bba-4289-8775-3fcd8074821ce7b79f56-2...\u003c/td\u003e\n      \u003ctd\u003eFeline Fix MixSnack-em FishFeline Fix MixPurrf...\u003c/td\u003e\n      \u003ctd\u003eRKAPY3I1TPORGRBTIKZRRKAPY3I1TP28LQOI0LSKA8SU9C...\u003c/td\u003e\n      \u003ctd\u003e11453.96\u003c/td\u003e\n      \u003ctd\u003e1026\u003c/td\u003e\n      \u003ctd\u003e22817.43\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth rowspan=\"4\" valign=\"top\"\u003edog\u003c/th\u003e\n      \u003cth\u003ebedding\u003c/th\u003e\n      \u003ctd\u003e5/22/20213/23/20203/23/20205/16/20215/14/20209...\u003c/td\u003e\n      \u003ctd\u003eSXF-7309-1727-1334DG7-5410-5845-1340DG7-5410-5...\u003c/td\u003e\n      \u003ctd\u003e476582ea-1bba-4289-8775-3fcd8074821c5929a0e9-9...\u003c/td\u003e\n      \u003ctd\u003eReddy BeddySnoozer EssentailsReddy BeddyReddy ...\u003c/td\u003e\n      \u003ctd\u003eDJWE1V9LZKGABWVMEL2RKDTMPSBZKZDJWE1V9LZKI2GQUN...\u003c/td\u003e\n      \u003ctd\u003e11906.83\u003c/td\u003e\n      \u003ctd\u003e953\u003c/td\u003e\n      \u003ctd\u003e24253.04\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003efood\u003c/th\u003e\n      \u003ctd\u003e3/23/20205/14/20209/12/20205/30/20219/26/20203...\u003c/td\u003e\n      \u003ctd\u003eDG7-5410-5845-1340VQE-2656-9729-61949K8-5765-4...\u003c/td\u003e\n      \u003ctd\u003e5929a0e9-95a7-4dbf-896e-c11d1988615e041686b3-e...\u003c/td\u003e\n      \u003ctd\u003eWhole Chemistry RecipeWhole Chemistry RecipeWh...\u003c/td\u003e\n      \u003ctd\u003e6K4AUUS7306K4AUUS7306K4AUUS730NYW2F6CPBY6K4AUU...\u003c/td\u003e\n      \u003ctd\u003e4593.70\u003c/td\u003e\n      \u003ctd\u003e505\u003c/td\u003e\n      \u003ctd\u003e9022.00\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003etoy\u003c/th\u003e\n      \u003ctd\u003e1/5/20201/5/20206/30/20216/22/20217/25/20219/2...\u003c/td\u003e\n      \u003ctd\u003e14C-6286-0019-467614C-6286-0019-4676TCS-6223-7...\u003c/td\u003e\n      \u003ctd\u003ee7b79f56-2196-49a0-852a-3d329ad7cb57e7b79f56-2...\u003c/td\u003e\n      \u003ctd\u003eTug-a-BackChomp-a PlushFetch BlasterChomp-a Pl...\u003c/td\u003e\n      \u003ctd\u003eIZBHF5KR793HDX5H4WTMM291KHJ4LW3HDX5H4WTMIZBHF5...\u003c/td\u003e\n      \u003ctd\u003e9746.13\u003c/td\u003e\n      \u003ctd\u003e662\u003c/td\u003e\n      \u003ctd\u003e19605.11\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003etreat\u003c/th\u003e\n      \u003ctd\u003e9/21/20199/14/20195/27/20217/7/20204/3/20195/2...\u003c/td\u003e\n      \u003ctd\u003eENT-5271-0660-4850G7Y-9331-8313-2949R3O-6541-4...\u003c/td\u003e\n      \u003ctd\u003ed13c8860-67ae-44fb-8827-7afa9b4eec7a5bc15bf9-0...\u003c/td\u003e\n      \u003ctd\u003eChewie DentalChewie DentalAll Veggie YummiesAl...\u003c/td\u003e\n      \u003ctd\u003eCG3531YP08CG3531YP08OWFPW3WZHGOWFPW3WZHGOWFPW3...\u003c/td\u003e\n      \u003ctd\u003e7409.18\u003c/td\u003e\n      \u003ctd\u003e453\u003c/td\u003e\n      \u003ctd\u003e14207.34\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n\n\n### Question 7: Determine which categories (`Product_Category`) by `Product_Line` have the median highest `Price`. Assign the (string) name of these categories to their respective variables priciest_category_cat and priciest_category_dog.\n\n\n```python\n# Grouping the DataFrame by 'Product_Line' and 'Product_Category' and calculating the median 'Price' for each group to identify which product category has the highest median price within each Product Line (cat and dog).\ndf.groupby(['Product_Line','Product_Category'])['Price'].median()\n\n# Based on the median prices calculated above, assigning the name of the product category with the highest median price for each product line to the respective variables.\npriciest_category_cat = 'bedding'\npriciest_category_dog = 'toy'\n```\n\n\n\n\n    Product_Line  Product_Category\n    cat           bedding             29.66\n                  food                24.53\n                  toy                 16.71\n                  treat               19.96\n    dog           bedding             28.04\n                  food                18.53\n                  toy                 29.47\n                  treat               25.48\n    Name: Price, dtype: float64\n\n\u003c/details\u003e\n\n# Data Visualization\n\n\u003cdetails\u003e\n  \u003csummary\u003eUsing the matplotlib and seaborn libraries to create visualizations.\u003c/summary\u003e\n\n### Question 8: You want to emphasize to your stakeholders that the total number of product categories sold differ between the two `Product_Line` categories ('cat' \u0026 'dog'). Create a horizontal bar plot that has `Product_Category` on the y-axis and the total number of that category sold (using the `Quantity`) by each `Product_Line` category. Also change the axis labels to something meaningful and add a title.\n\n\n```python\n# Creating a horizontal bar plot that meets the question requirements.\nax = sns.barplot(data=df, y='Product_Category', x='Quantity', estimator=sum, ci=None, hue='Product_Line')\n\n# Setting a meaningful title and labels.\nax.set_ylabel('Product Category')\nax.set_xlabel ('Total Products Sold')\nax.set_title = ('Total Number of Products Sold')\n\n```\n\n    /var/folders/73/442cck753ndc4t4bclgcnbr80000gn/T/ipykernel_41509/1645217559.py:2: FutureWarning: \n    \n    The `ci` parameter is deprecated. Use `errorbar=None` for the same effect.\n    \n      ax = sns.barplot(data=df, y='Product_Category', x='Quantity', estimator=sum, ci=None, hue='Product_Line')\n\n\n\n    \n![png](pet-store-transactions-analysis_files/pet-store-transactions-analysis_22_1.png)\n    \n\n\n### Question 9: Based on the plot from Question 8, what would you conclude for your stakeholders about what products they should sell? What would be the considerations and/or caveats you'd communicate to your stakeholders?\n\n\n```python\nanswer_to_9 = '''\nBased on the visualization, I would advise stakeholders to focus on treats for cats and bedding for dogs, as these appear to be the most popular products within their respective product lines, with toys also performing well. However, it's important to note that this analysis is based on a single dataset, which may not be the most up-to-date or account for seasonal trends.\n'''\n```\n\n### Question 10: Create an explanatory visualization that gives business stakeholders deeper insights into product sales trends.\n\n\n```python\n# Creating a box plot\nax = df.Price.plot.box()\n\nanswer_to_10 = '''\nI created a box plot to illustrate the distribution of product prices. The plot reveals that most product prices fall between approximately $17 and $35, with some notable outliers—prices as high as around $40 and as low as $11 or $12. This visualization not only highlights the central tendency and variability in pricing but also helps stakeholders understand the overall price range of the products. Such insights can inform pricing strategies, inventory decisions, and identify opportunities for adjustments to maximize revenue.\n'''\n```\n\n\n    \n![png](pet-store-transactions-analysis_files/pet-store-transactions-analysis_26_0.png)\n    \n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcostachar%2Fpet-store-transactions-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcostachar%2Fpet-store-transactions-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcostachar%2Fpet-store-transactions-analysis/lists"}