Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

In this project, I analyze commercial sales data using NumPy and pandas. I visualize total revenue per product using color-coded bar charts in Matplotlib. It’s a foundational step in business data analysis and project documentation.

License

Notifications You must be signed in to change notification settings

R01noq/Visualizing-Sales-Data-with-NumPy-and-Matplotlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

📊 Sales Data Analysis with NumPy and Matplotlib

This project is a beginner-to-intermediate level data analysis of sales data using pandas, NumPy, and Matplotlib. It demonstrates how to read, clean, analyze, and visualize sales information from a CSV file.


📂 Files

  • sales2_1.csv: The dataset.
  • sales2.py: Main Python script that processes and visualizes the data.
  • revenue_profit_chart.png: Output chart showing revenue per product.

🧠 Objectives

  • Convert raw sales data into useful insights.
  • Calculate total revenue per product.
  • Use NumPy for array manipulation and slicing.
  • Visualize results with a colorful, labeled bar chart.

🗂️ Dataset Description

The dataset contains the following columns:

  • Product: The name of the product.
  • Quantity: Units sold.
  • Price: Unit price in dollars.
  • Date: Date of sale.

🧮 Analysis Steps

  1. Read CSV Data using pandas.
  2. Convert Columns to Numeric types with error handling.
  3. Calculate Revenue per row (Price ×ばつ Quantity).
  4. Convert DataFrame to NumPy Array for slicing and filtering.
  5. Extract Unique Products and compute:
    • Total revenue per product.
    • Percentage share of total revenue.
  6. Visualize the Results using Matplotlib:
    • Each product is assigned a unique color.
    • Products are displayed as numbered bars.
    • A dynamic legend explains which number corresponds to which product.

📈 Output Example

Bar Chart


🛠️ Technologies Used

  • Python
  • pandas
  • NumPy
  • Matplotlib

💡 What You Will Learn

  • Data cleaning with pandas
  • NumPy slicing and boolean masking
  • Revenue calculation by category
  • Building clear, colorful visualizations
  • Working with legends and layout in Matplotlib

🚀 Future Improvements

  • Group data by date and analyze revenue trends over time.
  • Add Seaborn or Plotly for interactive visualizations.
  • Build a simple dashboard using Streamlit.

📬 Contact

If you like this project or have questions, feel free to connect:


🔖 License

This project is open-source and available under the MIT License.

About

In this project, I analyze commercial sales data using NumPy and pandas. I visualize total revenue per product using color-coded bar charts in Matplotlib. It’s a foundational step in business data analysis and project documentation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /