Write a Python program that uses the pandas library to load and manipulate a dataset. Perform basic exploratory data analysis, such as calculating summary statistics and visualizing distributions.
PLAINFORMAT
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

# Load the iris dataset
iris = sns.load_dataset('iris')

# Display the first 5 rows of the dataset
print("First 5 rows of the dataset:")
print(iris.head())

# Display summary statistics
print("\nSummary statistics:")
print(iris.describe())

# Calculate the correlation between variables
print("\nCorrelation matrix:")
print(iris.corr())

# Visualize the distributions of features using histograms
plt.figure(figsize=(10, 7))
iris.hist()
plt.tight_layout()
plt.show()

# Visualize pair-wise relationships between features using scatter plots
sns.pairplot(iris, hue='species')
plt.show()

# Visualize the distribution of species using count plot
sns.countplot(x='species', data=iris)
plt.show()

# Visualize the correlation matrix using heatmap
plt.figure(figsize=(8, 6))
sns.heatmap(iris.corr(), annot=True, cmap="coolwarm")
plt.show()