|
The Python Book
|
|
'Null' value in Python is 'None'
There's always only one instance of this object, so you can check for equivalence with x is None (identity comparison) instead of x == None
stackoverflow.com/questions/3289601/null-object-in-python
Missing data in Python
Roughly speaking:
- missing 'object' -> None
- missing numerical value ->Nan ( np.nan )
Pandas handles both nearly interchangeably, converting if needed.
- isnull(), notnull() generates boolean mask indicating missing (or not) values
- dropna() return filtered version of data
- fillna() impute the missing values
More detail: jakevdp.github.io/PythonDataScienceHandbook/03.04-missing-values.html
| |