0

I want to know whether there is any difference between using np.nan and None while using pandas dataframe or numpy arrays. If there is, where exactly does this difference matter?

ashish14
  • 650
  • 1
  • 8
  • 20
  • 1
    `np.nan` is a valid `float`, so can be an element of a `float` `dtype` `numpy` array. `None` is a Python object, and can only be an element of an `object` `dtype` array. – hpaulj Apr 29 '19 at 03:53

1 Answers1

-1

Np.nan means not a number and None can be applied in general to the other cases. np.nan can be used as a bool for example:

if('Hello' == np.nan)
Alec
  • 8,529
  • 8
  • 37
  • 63