| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Add nanmean, nanvar, and nanstd functions.
|
| |
| |
| |
| |
| |
| | |
Fix typos and clarify some explanations. Document the changes in the return
values of nanargmin and nanargmax for all-NaN slices in the 1.8.0 release
notes.
|
| |
| |
| |
| | |
This was raising a warning during tests.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
nanmax, nanmin
--------------
Add out and keepdims keywords.
nanargmin, nanargmax
--------------------
A NanWarning is raised if an all NaN slice detected. For all such
slices np.iingo(np.intp).min is returned as the index value.
nansum
------
The keywords dtype, out, and keepdims are added.
A FutureWarning is raised, as in the future the mean of an empty
slice after NaN replacement will be 0 instead of the current NaN.
nanmean, nanvar, nanstd
-----------------------
For all, if the input array is of inexact type then the dtype and out
parameters must be of inexact type if specified. That insures that NaNs
can be returned when appropriate.
The nanmean function detects empty slices after NaN replacement and
raises a NanWarning. NaN is returned as the value for all such slices.
The nanmean and nanstd functions detect degrees of freedom <= 0 after
NaN replacement and raise a NanWarning. NaN is returned as the value for
all such slices.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Test the mean, var, and std methods more extensively. In addition, add
tests that:
Check that scalar return types ar what they should be.
Check that ValueError is raised when ddof is too big.
|
| |
| |
| |
| |
| | |
Currently the results may be infinite or negative. Instead, raise a
ValueError in this case.
|
| |
| |
| |
| |
| | |
The return type could differ depending on whether or not the value
was a scalar.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Use issubclass instead of issubdtype.
Add some blank lines.
Remove trailing whitespace.
Remove uneeded float casts since true_divide is default.
Clean up documentation a bit.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
New files lib/nanfunctions.py and lib/tests/test_nanfunctions.py are
added and both the previous and new nan functions and tests are moved
into them.
The existing nan functions moved from lib/function_base are:
nansum, nanmin, nanmax, nanargmin, nanargmax
The added nan functions moved from core/numeric are:
nanmean, nanvar, nanstd
|
| | |
|
| | |
|
|\ \
| | |
| | | |
DOC: Remove references to diagonal changes in 1.8.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Not happening. Also remove reference to selecting multiple fields out of
an array returning a view from 1.8.0 release notes.
Closes #3228.
|
|\ \ \
| | | |
| | | | |
Update abi version and hash
|
| | | |
| | | |
| | | |
| | | |
| | | | |
In preparation for the 1.8 release, update the API version to
0x00000009 and the API hash to f99a02b75bd60205d1afe1eed080fd53.
|
| | |/
| |/|
| | |
| | |
| | | |
Scripts should not use relative imports as they won't work in a
non-package environment.
|
|/ / |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
On 32-bit platforms, was failing in casting the test
i8 index to i4. It may be desirable to allow this
in reduceat, but that change is independent of this pull
request.
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Bugfix: Regression when filling struct from tuple
|
| | | |
|
| |/ |
|
|/ |
|
|\
| |
| | |
DOC: Fix small typos in partition docstring.
|
| | |
|
|/ |
|
|\
| |
| | |
add quickselect algorithm and expose it via 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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A partition sorts the kth element into its sorted order and moves all
smaller elements before the kth element and all equal or greater
elements behind it.
The ordering of all elements in the partitions is undefined.
It is implemented via the introselection algorithm which has worst case
linear complexity compared to a full sort that has linearithmic
complexity.
The introselect algorithm uses a quickselect with median of three pivot
and falls back to a quickselect with median of median of five pivot if
no sufficient progress is made.
The pivots used during the search for the wanted kth element can
optionally be stored and reused for further partitionings of the array.
This is used by the python interface if an array of kth is provided to
the partitions function. This improves the performance of median and
which need to select two elements if the size of the array is even. A
percentile function interpolating between values also profits from this.
String selection is implemented in terms of quicksort which has the same
properties as a selection for now.
|
|/
|
|
|
|
|
|
| |
Some declarations that are not at the beginning of a block have slipped
into the code. This breaks compilation on Python3.4a1. The Numpy coding
standard also disallows that construct.
Closes #3598.
|
|\
| |
| | |
BUG: Fix test_operand_flags test.
|
| |
| |
| |
| |
| |
| |
| |
| | |
The test tests an inner loop in operand_flag_tests.c.src that expects
a long type, but it is tested using 'i8'. This fails when long is not
'i8'.
Closes #3363.
|
| | |
|
| | |
|
|\ \
| | |
| | | |
MAINT: move npy_is_aligned to common.h
|
| | |
| | |
| | |
| | |
| | |
| | | |
Use it for npy_is_aligned expecting alignments of the power of two.
Cuts down the time spent in _IsAligned by the testsuite relative
to the rest of multiarray.so from 0.6% to 0.4%
|
| | |
| | |
| | |
| | |
| | |
| | | |
also make it and some other alignment operators a bit faster by using
unsigned integers and bitwise and if possible.
Make use of npy_is_aligned in _IsAligned too.
|
| | |
| | |
| | |
| | | |
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
|
| |/
|/|
| |
| | |
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
|
|\ \
| | |
| | | |
ENH: use memchr for unit stride all/any
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Unroll the loop once and use pminub/pmaxub to save a slow pmovmskb
instruction. Improves performance by 50% on some AMD chips.
Also add a pure libc path using memcmp and memchr for non amd64 systems.
The libc path can be faster with a very modern cpu and libc version,
e.g. an i7 with glibc 2.17 is about 20% faster than our code but many
other tested platforms are much slower (2.12 xeon, core2duo) or same
speed (2.17 phenom).
The numpy code can be removed in future when faster libc versions and
cpus are more commonly available.
|
|/
|
|
| |
Deprecate np.testing.importall - it's pointless and partially broken.
|
|\
| |
| | |
ENH: inv/solve work with empty inner and others empty outer array
|
| |
| |
| |
| |
| |
| |
| | |
This makes the inverse of a 0x0 array simply be 0x0 again. It
also modifies the no-empty array check in favor of a no-empty
*inner* array, since the gufuncs seem to handle the other case
fine.
|
|\ \
| | |
| | | |
Documentation fixes for `basics.io.genfromtxt.rst` and `creation.py`
|
| | |
| | |
| | |
| | |
| | | |
Add missing part of usecols negative index explanation and other
minor redaction fixes.
|