|
57 | 57 | plt.title('Average Salaries per Department')
|
58 | 58 | plt.xlabel('Department')
|
59 | 59 | plt.ylabel('Average Salary')
|
| 60 | + output_file = "avg_salary.png" |
| 61 | + plt.savefig(output_file, bbox_inches='tight', dpi=300) |
60 | 62 | plt.show()
|
61 | 63 |
|
62 | 64 | # Average Bonus by Department
|
|
72 | 74 | plt.title('Average Bonus per Department')
|
73 | 75 | plt.xlabel('Department')
|
74 | 76 | plt.ylabel('Average Bonus')
|
| 77 | + output_file = "avg_bonus.png" |
| 78 | + plt.savefig(output_file, bbox_inches='tight', dpi=300) |
75 | 79 | plt.show()
|
76 | 80 |
|
77 | 81 | # Get the mean, median, standard deviation, and other statistics for the salary column in df_employees_salary
|
|
87 | 91 | plt.title('Distribution of Salary')
|
88 | 92 | plt.xlabel('Salary')
|
89 | 93 | plt.ylabel('Count')
|
| 94 | + output_file = "dist_salary.png" |
| 95 | + plt.savefig(output_file, bbox_inches='tight', dpi=300) |
90 | 96 | plt.show()
|
91 | 97 |
|
92 | 98 | # Calculate the correlation matrix between the salary and bonus columns in df_employees_salary
|
|
100 | 106 | plt.figure(figsize=(8,6))
|
101 | 107 | sns.heatmap(data=corr_matrix, cmap='coolwarm', annot=True)
|
102 | 108 | plt.title('Correlation Matrix Heatmap')
|
| 109 | + output_file = "correlation_matrix.png" |
| 110 | + plt.savefig(output_file, bbox_inches='tight', dpi=300) |
103 | 111 | plt.show()
|
104 | 112 |
|
105 | 113 | except SQLAlchemyError as e:
|
|
0 commit comments