ما تحتاجه هو القيام بالتالي:
import pandas as pd
import matplotlib.pyplot as plt
statistical = pd.read_csv("diabetes_clean.csv")
statistical = statistical.describe()
plt.figure(figsize=(12,11))
statistical.loc[["mean", "std", "min", "25%", "50%", "75%", "max"]].transpose().plot(kind='bar', figsize=(14,8))
plt.title("Statistical Summary of Diabetes Dataset")
plt.xlabel("Features")
plt.ylabel("Value")
plt.legend(["Mean", "Std", "Min", "25%", "50%", "75%", "Max"])
plt.tight_layout()
plt.show()
هنا plt.figure(figsize=(12,11)) نقوم بإنشاء رسم بياني بحجم 12x11 بوصة.
وفي الأسطر التي تليه نحدد شكل الرسم البياني.
بالنسبة لـ plt.tight_layout() فهي لضبط تخطيط الرسم البياني لضمان عرض جميع البيانات بشكل صحيح.