我發現我可能完成不了自我挑戰,我還在用統計報告
for column in df.columns:
plt.figure(figsize=(6, 4))
# Plot horizontal boxplot
plt.boxplot(df[column], vert=False)
plt.title(f'Horizontal Box Plot: {column}')
plt.xlabel('Value')
plt.ylabel(column)
plt.tight_layout()
# Save the plot
save_path = os.path.join(boxplot_directory, f'horizontal_boxplot_{column}.png')
plt.savefig(save_path)
plt.close()
boxplot_directory