4

I was wondering why the result of

pandas.Series([numpy.nan]).astype("bool")

is True?

Natig Aliyev
  • 379
  • 6
  • 18

1 Answers1

7

Probably because np.nan objects are themselves truthy:

>>> bool(np.nan)
True
Moses Koledoye
  • 77,341
  • 8
  • 133
  • 139