-1
I have a file. csv I’m treating, and the column ap_residencia_status should only be populated with floats but is filled with strings (even numeric values are strings) and the values that should be empty are filled with the string "N/D"
I would like to know how to filter and remove only the terms with the N/D string from my column, preserving the numeric values that are in string format (I want to change all to float once N/D is removed from the column)
Comrade, for some reason, your code removes some data from meudataframe, from 4027 lines to 9 columns fell to 3985 to 9 columns
– Kioolz
Yes. Wasn’t this the intention? Remove lines with N/D? You said in your question:
Pretendo alterar todos para float assim que remover os N/D da coluna
. Cannot remove N/D from column without removing entire row from Dataframe, friend. Otherwise, you would have a column with fewer rows than your Dataframe, and the pandas would send an error message.– user175765
Yes, it was. I’m sorry, I think I misquoted my intention. I would like to remove the string that is filling the matrix value, but I wanted it to appear "Nan" as it is in the other column. So that only an empty value is left in the matrix , not filled by string N/D
– Kioolz