
해당 개념들 정의를 위해 찾을때 가장 많이 돌아다니는 짤 ㅋㅋ..
test = NaN
print(test, type(test))
if test == NaN:
print("test == NaN")
elif test is NaN:
print("test is NaN")
else:
print("test is not NaN")
nan <class 'float'>
test is NaN
test = NA
print(test, type(test))
if test == NA: # TypeError: boolean value of NA is ambiguous
print("test == NA")
elif test is NA:
print("test is NA")
else:
print("test is not NA")
<NA> <class 'pandas._libs.missing.NAType'>
# test == NA가 없다면 test is NA에 걸림