Https://www.codecademy.com/paths/data-science/tracks/data-processing-pandas/modules/dspath-multiple-tables-pandas/projects/multi-tables-proj

https://www.codecademy.com/paths/data-science/tracks/data-processing-pandas/modules/dspath-multiple-tables-pandas/projects/multi-tables-proj

I am currently doing “page visits funnel” project under “multiple tables in pandas” topic in data science path.
I am stuck on 5th step.
how come we have to convert either numerator or denominator into float to get division answer in float data type?
In the beginning, we learned that python converts division answer into float data type if requires.

1 Like

@pradneshlachake23325,

Excellent question. It looks like this section is running Python 2 on the backend. In Python 2, you had to specify at least one of the numbers as a float if you wanted to use float division, as it defaulted to integer division. Python 2 also did not require parentheses around print statements, whereas Python 3 will throw a SyntaxError if you don’t include them. To confirm that the exercise is in Python 2, just try print "This is Python 2!"

Note: if you were to work on this exercise on your own computer (using Python 3), you would not have to include specify one of the numbers as a float.

2 Likes