Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
NumPy
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Limitations=== Inserting or appending entries to an array is not as trivially possible as it is with Python's lists. The {{code|np.pad(...)}} routine to extend arrays actually creates new arrays of the desired shape and padding values, copies the given array into the new one and returns it. NumPy's {{code|np.concatenate([a1,a2])}} operation does not actually link the two arrays but returns a new one, filled with the entries from both given arrays in sequence. Reshaping the dimensionality of an array with {{code|np.reshape(...)}} is only possible as long as the number of elements in the array does not change. These circumstances originate from the fact that NumPy's arrays must be views on contiguous [[Data buffer|memory buffers]]. [[Algorithm|Algorithms]] that are not expressible as a vectorized operation will typically run slowly because they must be implemented in "pure Python", while vectorization may increase [[Space complexity|memory complexity]] of some operations from constant to linear, because temporary arrays must be created that are as large as the inputs. Runtime compilation of numerical code has been implemented by several groups to avoid these problems; open source solutions that interoperate with NumPy include numexpr<ref>{{cite web |title=numexpr |url=https://github.com/pydata/numexpr |author=Francesc Alted |website=[[GitHub]] |access-date=8 March 2014}}</ref> and [[Numba]].<ref>{{cite web |title=Numba |url=http://numba.pydata.org/ |access-date=8 March 2014}}</ref> Cython and [[Pythran]] are static-compiling alternatives to these. Many modern [[Big data|large-scale]] scientific computing applications have requirements that exceed the capabilities of the NumPy arrays. For example, NumPy arrays are usually loaded into a computer's [[Volatile memory|memory]], which might have insufficient capacity for the analysis of large [[Data set|datasets]]. Further, NumPy operations are executed on a single [[Central processing unit|CPU]]. However, many linear algebra operations can be accelerated by executing them on [[Computer cluster|clusters]] of CPUs or of specialized hardware, such as [[Graphics processing unit|GPUs]] and [[Tensor Processing Unit|TPUs]], which many [[deep learning]] applications rely on. As a result, several alternative array implementations have arisen in the scientific python ecosystem over the recent years, such as [[Dask (software)|Dask]] for distributed arrays and [[TensorFlow]] or [[Google JAX|JAX]]<ref> Documentationː {{URL|https://jax.readthedocs.io/}} </ref> for computations on GPUs. Because of its popularity, these often implement a [[subset]] of NumPy's [[API]] or mimic it, so that users can change their array implementation with minimal changes to their code required.<ref name="Nature" /> A library named [[CuPy]],<ref>{{Citation|title=Shohei Hido - CuPy: A NumPy-compatible Library for GPU - PyCon 2018|url=https://www.youtube.com/watch?v=MAz1xolSB68 |archive-url=https://ghostarchive.org/varchive/youtube/20211221/MAz1xolSB68 |archive-date=2021-12-21 |url-status=live|language=en|access-date=2021-05-11}}{{cbignore}}</ref> accelerated by [[Nvidia]]'s [[CUDA]] framework, has also shown potential for faster computing, being a '[[drop-in replacement]]' of NumPy.<ref>{{Cite web|last=Entschev|first=Peter Andreas|date=2019-07-23|title=Single-GPU CuPy Speedups|url=https://medium.com/rapids-ai/single-gpu-cupy-speedups-ea99cbbb0cbb|access-date=2021-05-11|website=Medium|language=en}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)