Data science/Python

numpy debugging

연금(Pension)술사 2020. 2. 8. 20:18

TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''


아래와 같이 numpy 배열의 데이터타입이 object 인 경우. numpy 내에 object로 스트링으로 숫자나 글자들이 들어가있을 수도 있다. 추출한 행,열의 dtype을 확인하여라.


np
.isnan(np.array([np.nan, 0], dtype=object)) TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''


반응형