Apr-01-2019, 07:43 PM
Sounds like you want some of the values to be floats, and some of them to be ints. Have you tried just converting them?
>>> items = [0.0, 8.5, 15.5, 22.5] >>> list(item if item else int(item) for item in items) [0, 8.5, 15.5, 22.5]