Skip to content

Repository files navigation

Home Assignment, Data Processing script

Task Description

Write a script to process a dataset ('sample_dataset.csv'). The dataset contains the following columns:

['OrderID', 'Date', 'Region', 'Sales', 'Profit'].

The script should:

  1. Calculate and display:
  • Total sales.
  • Total profit.
  • The region with the highest sales.
  1. Group the data by region and output the total sales and profit for each region.
  2. Save a report (JSON or CSV) summarizing the above data.

Additional Requirements:

  • Use any language or libraries (e.g., Python + Pandas, JavaScript, etc.).
  • The script should handle basic errors (e.g., missing/incorrect file format).
  • The output report should be well-structured.

Bonus Points:

  • Visualize the results with a chart (e.g., bar chart of sales by region).
  • Include an option to filter the dataset by date range or region.
  • Write basic tests to validate key functions.

Implementation

Installation

This project is built on python version ( 3.13.1 )

You will find the required librarys in 'requirements.txt'

To install python, go to python website, download and install python 3.13.1 (or newer version) To install dependensies, in your shell , write pip install -r requirements.txt or pip3 install -r requirements.txt Now everything should be installed and ready to go.

Run example file

I have prepared an example file 'example_usage.py'. Run this in your shell: python test_data_processor.py or python3 test_data_processor.py to try out the function of the class

Unit Tests

Basic testing is written in unittest, theese are found in 'test_data_processor.py'

Run tests by writing in your shell: python test_data_processor.py or python3 test_data_processor.py

Thought process

I used jupyter notebooks as scratchpad for this assignment, take a look at my notes in thought_process.ipynb.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages