neuniversity / ALY6140

1 stars 3 forks source link

Data cleaning #47

Open NEUHU opened 5 years ago

NEUHU commented 5 years ago

Hi everyon,

I am still ecountering few issues when I was working on data cleaning part.

There are two kinds of empty data in my dataset, one kind of the empty data show as blank in the table, and the other kind of empty data show as "Nan".

I want to remove the blank type and remain the Nan type, is it possible to do that? Or should I replace the 'Nan' type with something else? I tried to use the code: "fillna" for this, but either nothing has change or the other command after this code become error.

I really feel frustrated about this whole thing... If anyone has any suggestion, please let me know! Thank you so much!

pr24 commented 5 years ago

You can fill those values with zeros(0)

Code for - df.fillna(0)

Or you can drop those columns if not required.

ShailuKonda commented 5 years ago

I advice you to replace the '-' symbol with NaN value. For better understanding drop the rows with NAN and any special characters.

ThatkidfromA commented 5 years ago

Hi,

In my opinion, you can fill the black column with 0 (as posted by pr24), then you try using this code df[df.columnsname != 0]