I am unable to remove scientific notation from a column containing both string and non-string entries.
When I import a dataset using read_csv, one of the column shows the following:
0 1.9157E+11
11 1.9157E+11
12 1.9157E+11
13 1.9157E+11
14 1.9157E+11
...
37444 19156794-1005
37445 19156794-1004
37446 19156791023
37447 19156794-1003
37448 19156794-1003
While all of the entries are encoded as strings, some rows contain only numbers (hence they are converted to scientific notation) and some rows contain "-" (hence they are displayed properly).
When I print dataframe['column'][11]
, I get '1.9157E+11'
, which is a string.
I am unable to use apply(float)
to the whole column because some of the entries contain '-', and therefore cannot be converted to string.
There was this question asked as well but the OP faced the same problem (see comments under solution) and no resolution was achieved.