I have a list which consists of float values but they\'re too detailed to proceed. I know we can shorten them by using the (\"%.f\" % variable) operator, like:
(\"%.f\" % variable)
Another option which doesn't require numpy is:
precision = 2 myRoundedList = [int(elem*(10**precision)+delta)/(10.0**precision) for elem in myList] # delta=0 for floor # delta = 0.5 for round # delta = 1 for ceil