df.dropna(subset=[columns],inplace=True)
a = a[~(np.isnan(a).any(axis=1))] # removes rows containing at least one nan
a = a[~(np.isnan(a).all(axis=1))] # removes rows containing all nan
df = df.dropna(axis = 0)
df = df[df.index.notnull()]
df = df[df['my_var'].notna()]
a = a[~(np.isnan(a).any(axis=0))] # removes columns containing at least one nan
a = a[~(np.isnan(a).all(axis=0))] # removes columns containing all nan
a[ ~np.isnan(a).any(axis=1),:]