diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/add_newdocs.py | 13 | ||||
-rw-r--r-- | numpy/ma/core.py | 15 |
2 files changed, 17 insertions, 11 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py index d1f6b3285..6be001f70 100644 --- a/numpy/add_newdocs.py +++ b/numpy/add_newdocs.py @@ -4460,11 +4460,14 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('view', (same shape, dtype, etc.) This does not cause a reinterpretation of the memory. - In cases when ``a.view(some_dtype)`` causes a reinterpretation of the - bytes of memory, its behavior cannot necessarily be predicted just from - the superficial appearance of ``a`` (shown by ``print(a)``). If ``a`` is - C-ordered versus fortran-ordered, versus defined as a transpose, versus - defined as a slice, etc., the view may give different results. + For ``a.view(some_dtype)``, if ``some_dtype`` has a different number of + bytes per entry than the previous dtype (for example, converting a + regular array to a structured array), then the behavior of the view + cannot be predicted just from the superficial appearance of ``a`` (shown + by ``print(a)``). It also depends on exactly how ``a`` is stored in + memory. Therefore if ``a`` is C-ordered versus fortran-ordered, versus + defined as a slice or transpose, etc., the view may give different + results. Examples diff --git a/numpy/ma/core.py b/numpy/ma/core.py index e895f8269..8f4bf9a08 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -2889,12 +2889,15 @@ class MaskedArray(ndarray): `dtype` is an ndarray sub-class), then the fill value is preserved. Finally, if `fill_value` is specified, but `dtype` is not, the fill value is set to the specified value. - - In cases when ``a.view(some_dtype)`` causes a reinterpretation of the - bytes of memory, its behavior cannot necessarily be predicted just from - the superficial appearance of ``a`` (shown by ``print(a)``). If ``a`` is - C-ordered versus fortran-ordered, versus defined as a transpose, versus - defined as a slice, etc., the view may give different results. + + For ``a.view(some_dtype)``, if ``some_dtype`` has a different number of + bytes per entry than the previous dtype (for example, converting a + regular array to a structured array), then the behavior of the view + cannot be predicted just from the superficial appearance of ``a`` (shown + by ``print(a)``). It also depends on exactly how ``a`` is stored in + memory. Therefore if ``a`` is C-ordered versus fortran-ordered, versus + defined as a slice or transpose, etc., the view may give different + results. """ if dtype is None: |