Looking back at the code I wrote for the last few posts I realized I made a couple of rookie mistakes. Here they are:
1. I called a variable "range", masking the range() built-in function.
2. I imported norm() and other statistical functions as:
from scipy.stats import norm
This practice is frowned upon, since it might introduce name conflicts. In a longer piece of code, norm() could refer to a normal distribution (in scipy.stats) or to the function used to compute the norm of a vector (in numpy.linalg). As the Zen of Python suggests, "Namespaces are one honking great idea -- let's do more of those!". This is the pythonic way of proceeding:
from scipy import stats
# and then uses stats.norm() for normal distributions
from numpy import linalg
# and linalg.norm() form vector norms
All you need to know about all you need to know about all - Kirill
ReplyDeleteIt's also kirill-kondrashin easy to remember the opening of 우리카지노 the Golden Nugget buffet. of the Golden Nugget Hotel Las Vegas, where I took over as well as