You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nicolas, this looks like a fantastic book. Thanks for sharing it.
I have one suggestion. In the "Conventions" section of the Preface, you include
import scipy as sp
as one of the imports. In fact, there is almost never a good reason to do this. All the "good stuff" in scipy is in the subpackages, and these must be explicitly imported (e.g. import scipy.ndimage, or common variations such as from scipy import ndimage, import scipy.ndimage as ndi, etc.).
The top level scipy namespace imports names from numpy, so you could use names such as sp.array and sp.linspace, but a better style is to just use the numpy namespace for that. I think many SciPy and NumPy developers now think that importing all of numpy into the scipy namespace was an API mistake, and using the scipy namespace that way should be discouraged. The only reason I can think of for ever importing just the top level name scipy is to access the version as scipy.__version__, and that's not a sufficient reason for including its import in the conventions for your book. So you could (and probably should) drop the line import scipy as sp from your list of conventions.
The text was updated successfully, but these errors were encountered:
Nicolas, this looks like a fantastic book. Thanks for sharing it.
I have one suggestion. In the "Conventions" section of the Preface, you include
as one of the imports. In fact, there is almost never a good reason to do this. All the "good stuff" in
scipy
is in the subpackages, and these must be explicitly imported (e.g.import scipy.ndimage
, or common variations such asfrom scipy import ndimage
,import scipy.ndimage as ndi
, etc.).The top level
scipy
namespace imports names fromnumpy
, so you could use names such assp.array
andsp.linspace
, but a better style is to just use thenumpy
namespace for that. I think many SciPy and NumPy developers now think that importing all ofnumpy
into thescipy
namespace was an API mistake, and using thescipy
namespace that way should be discouraged. The only reason I can think of for ever importing just the top level namescipy
is to access the version asscipy.__version__
, and that's not a sufficient reason for including its import in the conventions for your book. So you could (and probably should) drop the lineimport scipy as sp
from your list of conventions.The text was updated successfully, but these errors were encountered: