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
  • 600
  • 6
  • 19
  • 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
  • 7,110
  • 7
  • 28
  • 53