I\'m looking for a way to convert numbers to string format, dropping any redundant \'.0\'
The input data is a mix of floats and strings. Desired output:
0
So much ugliness out there…
My personal favorite is to convert floats that don't require to be a float (= when they actually are integers) to int, thus removing the, now useless, trailing 0
float
int
(int(i) if i.is_integer() else i for i in lst)
Then you can print them normally.