5,321
edits
(→Numpy) |
|||
Line 429: | Line 429: | ||
==Numpy== | ==Numpy== | ||
{{main | NumPy}} | |||
See also Cupy which is a numpy interface implemented with CUDA for GPU acceleration. Large speedups can be had for big arrays. | |||
===random=== | ===random=== | ||
Legacy code uses functions from <code>np.random.</code>. | Legacy code uses functions from <code>np.random.*</code>. | ||
New | New code should initialize a rng using <code>np.random.default_rng()</code>. | ||
See [https://numpy.org/doc/stable/reference/random/generator.html Random Generator] for more details. | |||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> |