Where does pip install its packages?

pip when used with virtualenv will generally install packages in the path <virtualenv_name>/lib/<python_ver>/site-packages. For example, I created a test virtualenv named venv_test with Python 2.7, and the django folder is in venv_test/lib/python2.7/site-packages/django.

Is there a ‘foreach’ function in Python 3?

Every occurence of “foreach” I’ve seen (PHP, C#, …) does basically the same as pythons “for” statement. These are more or less equivalent: So, yes, there is a “foreach” in python. It’s called “for”. What you’re describing is an “array map” function. This could be done with list comprehensions in python:

Should I use scipy.pi, numpy.pi, or math.pi?

So it doesn’t matter, they are all the same value. The only reason all three modules provide a pi value is so if you are using just one of the three modules, you can conveniently have access to pi without having to import another module. They’re not providing different values for pi.

sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)

This might happen inside scikit, and it depends on what you’re doing. I recommend reading the documentation for the functions you’re using. You might be using one which depends e.g. on your matrix being positive definite and not fulfilling that criteria. EDIT: How could I miss that: is obviously wrong. Right would be: and You … Read more