logo
Loading...

使用value_counts出現IndexingError: Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match - Cupoy

loc_a = app_train['OBS_60_CNT_SOCIAL_CIRCLE'].valu...

ml100-3,ml100-3-d09

使用value_counts出現IndexingError: Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match

2019/09/11 10:39 上午
機器學習共學討論版
嚴詩豪
觀看數:78
回答數:2
收藏數:0
ml100-3
ml100-3-d09

loc_a = app_train['OBS_60_CNT_SOCIAL_CIRCLE'].value_counts() < 20

loc_b = 'OBS_60_CNT_SOCIAL_CIRCLE'


app_train.loc[loc_a,loc_b].hist()

plt.show()


我是這樣寫loc_a = app_train['OBS_60_CNT_SOCIAL_CIRCLE'].value_counts() < 20
loc_b = 'OBS_60_CNT_SOCIAL_CIRCLE'

app_train.loc[loc_a,loc_b].hist()
plt.show()

我是這樣寫,然後他跳錯誤:

IndexingError: Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match


請問是哪裡出錯?