본문 바로가기

Programming/Python

[Python] Cannot perform ‘rand_’ with a dtyped [int64] array and scalar of type [bool]

df.loc[df.corr >= 0 & df.user_id == main_user_id ]

아래와 같이 바꿔주면 된다.

df.loc[(df.corr >= 0) & (df.user_id == main_user_id) ]

 

참고

https://www.statology.org/cannot-perform-rand_-with-a-dtyped-int64-array-and-scalar-of-type-bool/