This project provides a Python script to read Amazon product reviews from a CSV file, collect usernames for a specific product ID, and visualize the data using Matplotlib.
-
Clone the repository to your local machine:
git clone https://github.com/<your-username>/amazon-reviews-analysis.git cd amazon-reviews-analysis
-
Install the required Python packages:
pip install matplotlib pandas pytest
-
Ensure you have the
amazon.csvfile in the same directory as the script. The CSV file should contain the following columns:product_idusername- Other relevant columns
-
Run the script to read data from the CSV file, collect usernames, and visualize the data:
python collect_usernames.py
read_data(file_path): Reads data from the CSV file.collect_usernames_for_product(data, product_id): Collects usernames for the specified product ID.visualize_usernames(usernames, product_id): Visualizes the count of reviews per user for the specified product ID.
Dataset retrieved from https://www.kaggle.com/datasets/karkavelrajaj/amazon-sales-dataset