When I do a division in Python/Pandas (e.g. 47/100) how do I show
the decimal value of the answer, because at the moment it just shows as
0?
Thanks in
advance.
Answer
If you're using python2.x, you need to
"floatify"1 one of your
numbers:
float(47)/100
47.0/100
As
python2.x will do integer division if both numbers in the division are
integers.
1floatify:
Forcing a number to be a float
No comments:
Post a Comment