Closed hillarygreenlerman closed 6 years ago
https://github.com/buschbirk/intro-data-capstone-musclehub/blob/66253a292dbe1c2e164ec5b57ff40c1a6da26ecf/Final%20Analysis/musclehub.py#L213
None objects are tricky. There are several correct ways to test for them:
None
is
foo = None print(foo is None) >> True
isnull
import pandas as pd foo = None print(pd.isnull(foo)) >> True
This idiom is particularly nice when testing an entire column in a DataFrame.
This StackOverflow article goes into more detail about why is syntax is preferred: https://stackoverflow.com/questions/3965104/not-none-test-in-python
https://github.com/buschbirk/intro-data-capstone-musclehub/blob/66253a292dbe1c2e164ec5b57ff40c1a6da26ecf/Final%20Analysis/musclehub.py#L213
None
objects are tricky. There are several correct ways to test for them:is
isnull
:This idiom is particularly nice when testing an entire column in a DataFrame.
This StackOverflow article goes into more detail about why
is
syntax is preferred: https://stackoverflow.com/questions/3965104/not-none-test-in-python