I have to drop rows whose values is NaN in a specific Column ('Class') in my Dataframe. I know it is a common question and there is a lot of answers for it but I tried all ways that I found but nothing works. I tried it with:
dataset=dataset.dropna(axis='columns')
dataset = dataset[dataset['Class'].notna()]
dataset=dataset.dropna(subset=['Class'])
dataset = dataset[pd.notnull(dataset['Class'])]
I read the documentation on pandas website and tried all ways also the variant with df.dropna(how='any')
but nothing is working and I still have the rows with the NaN values. Do anyone know why is that or how I can fix it?