Pandas

Save to CSV

Here without row names (index) index=False.

df.to_csv('<path_or_buf>', index=False)

also see: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_csv.html

Filter nan Values

nan == nan is always false. That is why we can not use == to check for nan-values. Use pd.isnull(obj : scalar or array-like) instead or isnull(). Examples:

df.loc[pd.isnull(df['col'])]
df[df['col'].isnull()]