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
Copy file name to clipboardExpand all lines: lectures/scipy.md
+3-9Lines changed: 3 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,17 +49,11 @@ In this lecture, we aim only to highlight some useful parts of the package.
49
49
50
50
SciPy is a package that contains various tools that are built on top of NumPy, using its array data type and related functionality.
51
51
52
-
In fact, when we import SciPy we also get NumPy, as can be seen from this excerpt the SciPy initialization file:
52
+
In older versions of SciPy, importing SciPy would also import NumPy symbols into the global namespace.
53
53
54
-
```{code-cell} python3
55
-
# Import numpy symbols to scipy namespace
56
-
from numpy import *
57
-
from numpy.random import rand, randn
58
-
from numpy.fft import fft, ifft
59
-
from numpy.lib.scimath import *
60
-
```
54
+
However, modern versions of SciPy (1.15+) have a cleaner approach and no longer automatically import NumPy symbols. This is better practice as it avoids namespace pollution.
61
55
62
-
However, it's more common and better practice to use NumPy functionality explicitly.
0 commit comments