✍Tips and Tricks in Python
Warning: There is no magical formula or Holy Grail here, though a new world might open the door for you.
📈Python For Finance Series
- Identifying Outliers
- Identifying Outliers — Part Two
- Identifying Outliers — Part Three
- Stylized Facts
- Feature Engineering & Feature Selection
- Data Transformation
- Fractionally Differentiated Features
- Data Labelling
- Meta-labeling and Stacking
TL;NR:
- First of all, there is no
pd.nan
, but do havenp.nan
. - if a data is missing and showing NaN, be careful to use
NaN ==np.nan
.np.nan
is not comparable tonp.nan
... directly.
np.nan == np.nanFalse
NaN is used as a placeholder for missing data consistently in pandas, consistency is good. I usually read/translate NaN as “missing”. Also see the ‘working with missing data’ section in the docs.
Wes writes in the docs ‘choice of NA-representation’: