You are probably using Python 2. You can "fix" the separation using:
from __future__ import division
at the beginning of your script (before any other import). By default, in Python 2, the / operator performs integer division when using integer operands, which discards the fractional parts of the result.
This has been changed in Python 3, so / always a floating point division. The new operator // performs integer division.
Greg hewgill
source share