我正在使用此代碼繪制 df 中的所有資料:
m_cols = ['is_canceled','lead_time', 'arrival_date_year','arrival_date_week_number','arrival_date_day_of_month','stays_in_weekend_nights','adults','children','babies','is_repeated_guest','previous_cancellations','previous_bookings_not_canceled','booking_changes','agent','total_of_special_requests']
for col in num_cols:
sns.boxplot(y=df['is_canceled'].astype('category'),x=col,data=df)
plt.show()
但是我有一些看起來像這樣的圖,我該如何解決?
uj5u.com熱心網友回復:
箱線圖似乎顯示大部分值為零,其余的顯示為例外值。所以例如previous_annulations 通常為零,一些有一些特定的值。具有相同值的所有例外值都繪制在彼此之上。請注意,a 的“框”
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/357827.html
標籤:Python 熊猫 matplotlib 海生
上一篇:MatplotlibColorbar與散布顏色不同?
下一篇:使用回圈為多列創建子圖
