data-science-from-scratch
data-science-from-scratch copied to clipboard
Please add a new comment about `from __future__ import division`
Please add a new comment about from __future__ import division
When someone is new to Python and he follows your directions step by step then he wiil find his is trapped by the book code sample like this:
from __future__ import division # integer division is lame
This statement must be put at the head of the code
num_users = len(users) # length of the users list
avg_connections = total_connections / num_users # 2.4
That will be more useful and clear and it will be convenient for people to follow your code step by step.