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?
On performing division in jupyter notebook, it is printing only the integer part of quotient. How to fix it?
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.
__future__ import division
It will then show the fraction on division
you can make any numerator / denominator as fraction i.e. 273.0