diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2013-05-23 23:53:23 +0200 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2013-08-12 14:25:53 +0200 |
commit | 4d9cd695486fa095c6bff3238341a85cbdb47d0e (patch) | |
tree | 0ef3bad5d6596beca0b52ac980da1f7870aeea58 /doc | |
parent | 9c4c1c432b27f67eee2ad22ff5f2f9833bd1516d (diff) | |
download | numpy-4d9cd695486fa095c6bff3238341a85cbdb47d0e.tar.gz |
ENH: implement median in terms of partition
Partitioning is sufficient to obtain the median and is much faster.
In the case of overwrite_input=True the resulting array will not be
fully sorted anymore.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/1.8.0-notes.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/release/1.8.0-notes.rst b/doc/release/1.8.0-notes.rst index e0f233d86..6fd3917da 100644 --- a/doc/release/1.8.0-notes.rst +++ b/doc/release/1.8.0-notes.rst @@ -98,6 +98,10 @@ a (potentially expensive) array conversion of ``<non-array-subclass>`` had been attempted. (`bug <https://github.com/numpy/numpy/issues/3375>`_, `pull request <https://github.com/numpy/numpy/pull/3501>`_) +Function `median` used with `overwrite_input` only partially sorts array +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +If `median` is used with `overwrite_input` option the input array will now only +be partially sorted instead of fully sorted. New Features ============ @@ -215,6 +219,13 @@ at compile time. It is enabled by default on x86_64 systems. On x86_32 with a capable CPU it must be enabled by passing the appropriate flag to the CFLAGS build variable (-msse2 with gcc). +Performance improvements to `median` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +`median` is now implemented in terms of `partition` instead of `sort` which +reduces its time complexity from O(n log(n)) to O(n). +If used with the `overwrite_input` option the array will now only be partially +sorted instead of fully sorted. + Changes ======= |