# 9.12:  Compare None to np.nan.

import numpy
import pandas

pynone     = None            # means "empty"
not_a_num  = np.nan          # means "indeterminate number"

print(f'None:   {type(pynone)}: {bool(pynone)}')                # <class 'NoneType'>:  False
print(f'np.nan: {type(not_a_num)}:    {bool(not_a_num)}')       # <class 'float'>: True

# np.nan is a float, principally because it needs to work in math calculations (for example, summing
# up a column that might have empty values).
# 
# np.nan is True in a boolean context because it's a non-zero float -- so following Python's rules
# of "truthiness" is must be True.  To identify it, we'll use pandas' specific methods .isna(), etc.

