diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-01-03 18:05:50 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-01-06 14:53:06 -0700 |
commit | f80d5e06485b59f8ece7421a3a81b809dd5f78f5 (patch) | |
tree | bee77beb13956af6064be391c47159c5cd521f1a /doc | |
parent | ea927d961dfc32b6963aed3b3a10bc51c12543df (diff) | |
download | numpy-f80d5e06485b59f8ece7421a3a81b809dd5f78f5.tar.gz |
DOC: Document changes to diag, diagonal, ravel in 1.10-notes.rst.
The changes are that they all preserve ndarray subtypes with the
exception of ravel, which still return 1-D arrays for backward
compatibility.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/1.10.0-notes.rst | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/doc/release/1.10.0-notes.rst b/doc/release/1.10.0-notes.rst index 1fdbb84bd..6403283d1 100644 --- a/doc/release/1.10.0-notes.rst +++ b/doc/release/1.10.0-notes.rst @@ -41,11 +41,13 @@ NPY_RELAXED_STRIDE_CHECKING is now true by default. *np.ravel*, *np.diagonal* and *np.diag* now preserve subtypes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -There was inconsistent behavior between *x.ravel()* and *np.ravel(x)*, as well -as between *x.diagonal()* and *np.diagonal(x)*. For example, if *x* was a -matrix, then *x.ravel()* returned a matrix, while *np.ravel(x)* returned an -ndarray. In the case of matrices, the returned value will have different -dimensions and that may lead to problems in using the result. +There was inconsistent behavior between *x.ravel()* and *np.ravel(x)*, as +well as between *x.diagonal()* and *np.diagonal(x)*, with the methods +preserving subtypes while the functions did not. This has been fixed and +the functions now behave like the methods, preserving subtypes except in +the case of matrices. Matrices are special cased for backward +compatibility and still return 1-D arrays as before. If you need to +preserve the matrix subtype, use the methods instead of the functions. New Features |