The purpose of this project is to demonstrate basic data analysis and visualization skills using Python's pandas, matplotlib, and seaborn libraries. The analysis uses the classic Iris dataset, a popular dataset for classification and pattern recognition tasks in data science and machine learning.
├── iris\_analysis.ipynb # Jupyter notebook with code, visualizations, and insights
├── iris\_analysis.py # Python script version of the analysis
├── README.md # Project documentation
- Python 3.x
- Pandas
- NumPy
- Matplotlib
- Seaborn
- Scikit-learn (for loading the Iris dataset)
- Source: Scikit-learn’s built-in datasets
- Features:
- Sepal Length (cm)
- Sepal Width (cm)
- Petal Length (cm)
- Petal Width (cm)
- Target: Iris Species (Setosa, Versicolor, Virginica)
- Loaded the Iris dataset using
sklearn.datasets.load_iris(). - Converted it into a pandas DataFrame.
- Inspected data using
.head()and.info(). - Checked for missing values.
- Verified data types.
- Used
.describe()to compute statistics like mean, median, and standard deviation. - Performed groupings by species and calculated the mean of features.
- Identified notable trends and differences between species.
Created the following plots:
- Line Chart – Showing petal length trends across samples.
- Bar Chart – Comparing average sepal width for each Iris species.
- Histogram – Displaying distribution of petal length.
- Scatter Plot – Visualizing relationship between sepal length and petal length.
All plots were customized with titles, axis labels, legends, and gridlines.
- Setosa species has significantly smaller petal lengths and widths compared to the other two.
- There is a strong positive correlation between petal length and sepal length.
- Versicolor and Virginica have more overlap in feature values, which makes them harder to separate visually.
- Added
try-exceptblock to handle dataset loading errors gracefully. - Ensured that missing data (if any) is handled by checking with
.isnull().sum().
- Python Script:
python iris_analysis.py
2. **Jupyter Notebook**:
Open `iris_analysis.ipynb` in Jupyter Notebook or VS Code and run all cells.
---
## Author
This project was completed as part of a Python assignment focusing on data analysis and visualization techniques.
---
## Contact
For questions or feedback, feel free to reach out.