Untitled

 avatar
unknown
plain_text
a year ago
933 B
2
Indexable
import matplotlib.pyplot as plt
import numpy as np

# Data
years_experience_before = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
one_month_after = [4, 2, 2, 2, 1, 0, 1, 3, 3, 0, 2, 2, 3, 0, 0, 1, 2, 0, 1, 2, 1, 2, 0]
six_months_after = [1, 3, 3, 3, 2, 2, 2, 2, 3, 1, 3, 3, 3, 1, 1, 2, 3, 1, 2, 3, 3, 3, 0]

# Calculate the average for each category
avg_before = np.mean(years_experience_before)
avg_one_month_after = np.mean(one_month_after)
avg_six_months_after = np.mean(six_months_after)

# Plotting
categories = ['Before Training', '1 Month After Training', '6 Months After Training']
values = [avg_before, avg_one_month_after, avg_six_months_after]

plt.bar(categories, values, color=['blue', 'orange', 'green'])
plt.ylabel('Average Years of Experience')
plt.title('Average Years of Experience Before and After Training')
plt.ylim(0, 5) # Adjust the y-axis limits if necessary
plt.show()
Leave a Comment