From 8c3112a44cd4f453443a25af3d39a986a1c7038c Mon Sep 17 00:00:00 2001 From: David Rotermund <54365609+davrot@users.noreply.github.com> Date: Fri, 15 Dec 2023 00:48:32 +0100 Subject: [PATCH] Update README.md Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com> --- numpy/ndarray/README.md | 63 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/numpy/ndarray/README.md b/numpy/ndarray/README.md index 8a99720..bed17fb 100644 --- a/numpy/ndarray/README.md +++ b/numpy/ndarray/README.md @@ -89,6 +89,69 @@ A = np.ones((3, 3)) print(A.size) # -> 9 ``` +## [numpy.ndarray.nbytes](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.nbytes.html) + +{: .topic-optional} +This is an optional topic! + +```python +ndarray.nbytes +``` + +> Total bytes consumed by the elements of the array. + + +## [numpy.ndarray.itemsize](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.itemsize.html) + +{: .topic-optional} +This is an optional topic! + +```python +ndarray.itemsize +``` + +> Length of one array element in bytes. + +## [numpy.ndarray.copy](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.copy.html) + +```python +ndarray.copy(order='C') +``` + +> Return a copy of the array. + + +## [numpy.ndarray.view](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.view.html) + +```python +ndarray.view([dtype][, type]) +``` + +> New view of array with the same data. + +## [numpy.ndarray.reshape](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.reshape.html) + +```python +ndarray.reshape(shape, order='C') +``` + +> Returns an array containing the same data with a new shape. + +```python +import numpy as np + +A = np.arange(0, 6) +print(A.reshape((2, 3))) +``` + +Output: + +```python +[[0 1 2] + [3 4 5]] +``` + + ## [Array methods](https://numpy.org/doc/stable/reference/arrays.ndarray.html#array-methods)