Hi,
I have read csv file in dataframe, and I want to delete column if entire column values are equal to "nan"
data.csv:
I use the below code:
I have read csv file in dataframe, and I want to delete column if entire column values are equal to "nan"
data.csv:
Name Rank subname prevname USA Ca 12 23 nan USA WD 25 78 nan RSA 45 nan nannot always the entire 3rd row has "nan" values.
I use the below code:
import pandas as pd df=pd.read_csv(r'data.csv') df.dropna(axis=1, how='all')