My dataframe has 80 columns by 1 million rows.
There is a lot of NaN in the dataset, if I were to drop all NA values I would lose way too much data for it to be useful.
I was wondering if there was a way to go through the columns and when it would do any calculations later on, like mean, medium, mode, or more advanced calculations, it would just pretend the values aren't there.
It's not always as just NaN, it sometimes includes values like "Infinity" which should be ignored.
Is there something like:
Find NaN and Infinity in Dataframe, flag them and DO NOT CONSIDER them IN CALCULATIONS
I tried finding a command to do it but any information on it, maybe I'm just being silly.