diff options
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/core/_add_newdocs.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/numpy/core/_add_newdocs.py b/numpy/core/_add_newdocs.py index 36fc9d7d6..5ff12a2c7 100644 --- a/numpy/core/_add_newdocs.py +++ b/numpy/core/_add_newdocs.py @@ -4129,14 +4129,14 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('view', Parameters ---------- dtype : data-type or ndarray sub-class, optional - Data-type descriptor of the returned view, e.g., float32 or int16. The - default, None, results in the view having the same data-type as `a`. + Data-type descriptor of the returned view, e.g., float32 or int16. + Omitting it results in the view having the same data-type as `a`. This argument can also be specified as an ndarray sub-class, which then specifies the type of the returned object (this is equivalent to setting the ``type`` parameter). type : Python type, optional - Type of the returned view, e.g., ndarray or matrix. Again, the - default None results in type preservation. + Type of the returned view, e.g., ndarray or matrix. Again, omission + of the parameter results in type preservation. Notes ----- @@ -4160,6 +4160,11 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('view', defined as a slice or transpose, etc., the view may give different results. + Passing None explicitly for ``dtype`` is different from omitting the + parameter, since the former invokes ``dtype(None)`` which is an alias for + ``dtype('float_')``. Similarly, explicitly passing None for ``type`` + is an error. + Examples -------- |
