python pandas how to check in what columns there are empty values(NaN)
import pandas as pd
df = pd.read_csv("file path.csv")
null=pd.DataFrame(df.isnull().sum(),columns=["Null Values count"]) # gets a dataset with all of the columns and the number of Null values in it
null["Null values percentage"]=(df.isna().sum()/len(df)*100) # adds a column with the % of the Null out of all of the column
null = null[null["Null values percentage"] > 0] # keep only the ones that has Null values
null.style.background_gradient() # prints it in a pretty way
# If you are doing any conditional operation and you want to check a if
# a single value is Null or not then you can use numpy's isna method.
np.isna(df[col][0])