pandas where leaves nan code example
Example 1: pandas where retuning NaN
# Try using a loc instead of a where:
df_sub = df.loc[df.yourcolumn == 'yourvalue']
Example 2: represent NaN with pandas in python
import pandas as pd
if pd.isnull(float("Nan")):
print("Null Value.")