This project performs an analysis of food data, including visualizations and statistical insights. The data is processed and analyzed to provide insights on nutritional values, categories, and distributions. It utilizes pandas
for data manipulation and matplotlib
for visualization.
-
Loading and Inspecting Data
- The food data is loaded from a CSV file (
food_data.csv
). - Basic inspections of the data are performed, including checking the first few rows and the overall data structure.
- The food data is loaded from a CSV file (
-
Groupwise Analysis
- The data is grouped by
description_category
, and the average nutritional values (amount
) are computed for each category. - A bar chart visualizes the average nutritional values for each food category.
- The data is grouped by
-
Finding Extremes
- The highest and lowest nutritional values are identified and printed.
-
Category Distribution
- The distribution of food categories is displayed using a horizontal bar chart showing the number of entries in each category.
-
Time Series Analysis (If applicable)
- If a
date
column is available, the data is resampled monthly to calculate the average nutritional values over time. - A time series plot is generated to show the trend in nutritional values.
- If a
-
Sum of Nutritional Values by Category
- A bar chart visualizes the total nutritional value (
amount
) for each food category.
- A bar chart visualizes the total nutritional value (
-
Boxplot of Nutritional Values
- A boxplot displays the distribution of nutritional values within each category.
-
Histogram of Nutritional Values
- A histogram is generated to visualize the distribution of nutritional values across all food items.
To run this project, ensure you have the following Python libraries installed:
pandas
matplotlib
You can install these libraries using pip:
pip install pandas matplotlib
git clone https://github.com/deliprofesor/Odev3-Merge.git
cd Odev3-Merge
python aap.py