While trying to work on a project with pandas I have run into a problem. I had a list with a nan value in it and I couldn’t remove it.
I have tried:
incoms=data['int_income'].unique().tolist()
incoms.remove('nan')
But it didn’t work:
list.remove(x): x not in list"
The list incoms is as follows:
[75000.0, 50000.0, 0.0, 200000.0, 100000.0, 25000.0, nan, 10000.0, 175000.0, 150000.0, 125000.0]