On performing division in jupyter notebook, it is printing only the integer part of quotient. How to fix it?



Hello everyone,
I am working on data exploration in my Jupyter notebook. To find a particular fraction, I divided 273 by 1003 by the following command
I was expecting some fraction but it printed 0. Can anyone help me to fix it?


Hi Vikas,

I think you are using python 2.7. This is the default behavior for integer divison
Please use the following import on the top of your notebook.

from __future__ import division

It will then show the fraction on division


you can make any numerator / denominator as fraction i.e. 273.0