import matplotlib.pyplot as plt

labels = [ "A", "B", "C", "D", "E" ]
yValues = [ 10, 40, 36, 46, 21 ]
lst = [ "red", "yellow", "green", 
        "blue", "purple" ]
plt.bar(labels, yValues, color=lst)
plt.show()

###

import pandas as pd

df = pd.read_csv("penguins.csv")
print(df)

print(df.describe())
print(df.info())

plt.hist(df["body_mass_g"])
plt.show()

###

# 1. Calculate mean and standard deviation (dropping missing values)
mass_data = df["body_mass_g"]
mean = mass_data.mean()
std = mass_data.std()

# 2. Plot the histogram
plt.hist(mass_data)

# 3. Add vertical line for the mean
plt.axvline(
    mean,
    color="red",
    linestyle="dashed",
    linewidth=2,
    label=f"Mean: {mean:.1f}g",
)

# 4. Add vertical lines for mean ± 1 standard deviation
plt.axvline(
    mean - std,
    color="orange",
    linestyle="dotted",
    linewidth=2,
    label=f"-1 STD: {mean - std:.1f}g",
)
plt.axvline(
    mean + std,
    color="orange",
    linestyle="dotted",
    linewidth=2,
    label=f"+1 STD: {mean + std:.1f}g",
)

# 5. Format plot details
plt.xlabel("Body Mass (g)")
plt.ylabel("Frequency")
plt.title("Penguin Body Mass Distribution")
plt.legend()

plt.show()