Suppose have following data frame
A B
1 2 3 4 5
4 5 6 7 8
I want to check if df(0,0)
is nan
then insert pd.series(np.nan) at 0th position. So in above case it will be
A B
1 2 3 4 5
4 5 6 7 8
I am able to check (0,0)
element but how do I insert empty row at first position?
df.loc[len(df)] = np.NaN
. Ok for me.