logo
Loading...

dataframe資料篩選問題 - Cupoy

# 將 GrLivArea 限制在 800 到 2500 以內, 捨棄離群值 keep_indexs...

ml100-2,keep_indexs,ml100-2-d20

dataframe資料篩選問題

2019/05/06 03:58 PM
機器學習新手論壇
陳秉涵
觀看數:0
回答數:2
收藏數:1
ml100-2
keep_indexs
ml100-2-d20

# 將 GrLivArea 限制在 800 到 2500 以內, 捨棄離群值 

keep_indexs = (df['GrLivArea']> 800) & (df['GrLivArea']< 2500) 

df = df[keep_indexs] 

train_Y = train_Y[keep_indexs] 

sns.regplot(x = df['GrLivArea'], y=train_Y) 

plt.show()