I am facing an issue in data frame of removing .0
My data looks like
Age
3.5
9.0
7.6
8.7
4.0
And I want it to looks like
Age
3.5
9
7.6
8.7
4
It's only a sample, the real data frame is too big with more than 50 columns having the same problem, so please suggest me the answer which can directly be applied to the whole data frame instead of individual columns.
I am trying to convert by below method but it's not working
def myconverter(o):
if isinstance(o, float):
if o == int(o):
return int(o)
return o.__str__()
org.postgresql.util.PSQLException: ERROR: invalid input syntax for integer: "309.0"