np.nan is used to represent missing data in pandas.
Reindexing allows you to change/add/delete the index on a specified axis. This returns a copy of the data.
import numpy as np
import pandas as pd
s = pd.Series([1, 4, np.nan, 6, 8])
dates = pd.date_range('20190101', periods=8)
df = pd.DataFrame(np.random.randn(8, 4), index=dates, columns=list('PQRS'))
df1 = df.reindex(index=dates[0:4], columns=list(df.columns) + ['E'])
df1.loc[dates[0]:dates[1], 'E'] = 1
df1
To drop any rows that have missing data.
df1.dropna(how='any')
Filling missing data.
df1.fillna(value=5)
To get the boolean mask where values are nan.
pd.isna(df1)