How to delete a row if a values in a column is not NaN In the given code it displays only the rows without NaN values but i want only the rows with NaN values in a provided column everything has to be removed    

df1 = df1[pd.notnull(df1['column_name'])]
If I am correct, you are looking to keep only the NaN values. You can use pd.isnull() to check which rows are NaN and then only keep those. Try this:

df1 = df1[pd.isnull(df1['column_name'])]