| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | |
|
|/ / |
|
|/
|
|
|
|
|
|
| |
Per the mailing list discussion [1], I have implemented a new function
`broadcast_to` that broadcasts an array to a given shape according to
numpy's broadcasting rules.
[1] http://mail.scipy.org/pipermail/numpy-discussion/2014-December/071796.html
|
|
|
|
|
|
|
| |
The tests were using assert_almost_equal and setting the precision to 3
decimals. The reason for that low precision appears to have been the
failure of the tests for a more reasonable precision. The fix was to use
assert_allclose instead.
|
|
|
|
|
|
|
|
|
| |
The pmt function in financial.py does a zero divide when rate=0 because
error because the alternatives in np.where() are evaluated befor the
selection is made.first before going into the function however, the
denominator can be zero at that time.
Closes #4701.
|
|
|
|
| |
The strings must be produced by the python float.hex method.
|
|
|
|
| |
Also, added unittest for [int, array] combination arguments
|
|\
| |
| | |
BUG: Fix genfromtext NameValidator arguments passed to easy_dtype.
|
| |
| |
| |
| |
| |
| |
| | |
The function was useing `'u' in case_sensitive` to detect `upper`.
Make that more precise with `case_sensitive.startswith('u').
Raise ValueError if case_sensitive has unrecognized value.
|
| |
| |
| |
| |
| |
| |
| | |
The case_sensitive argument to np.recfromcsv has a default value of
'lower'. That value was not previously correctly passed on, but is
now, so the previous expected values in this test were incorrectly
upper cased.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
np.genfromtxt validates field names twice: once in genfromtxt and once
in easy_dtype. Whilst the arguments to genfromtxt are used in the first
validation, they aren't passed to easy_dtype (which is used only when
dtype != None) and therefore in this case the default validation (strip
non-alphanum, replace spaces) gets confusingly applied, ignoring
genfromtxt's arguments.
This patch adds fixes genfromtxt by passing the appropriate arguments
onwards to easy_dtype. That is probably the least invasive way to fix
the issue.
|
| | |
|
|/
|
|
|
|
|
|
|
|
| |
This allows one to specify the maximum number of row processed in
in a call. The new functionality allows for reading more complex
data formats. For instance, multiple calls can be used to read in
multiple arrays stored in a single file.
Closes #5084.
Closes #5093.
|
| |
|
|\
| |
| | |
ENH: Improve arg handling & enhance test suite for `np.pad`
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
| |
This PR adds an implementation of `nanprod`.
The actual function is a two-liner adapted from `nansum`. Most of this PR
consists of documentation and tests (for which I took the opportunity to do
some consolidation).
A method with the same functionality exists in pandas, and I was surprised to
discover that it's not in numpy.
|
|
|
|
|
| |
The new searchsorted-based digitize introduced in #5101 segfaults
when it should raise a TypeError.
|
|\
| |
| | |
MAINT: refactor packbits/unpackbits
|
| | |
|
| |
| |
| |
| |
| |
| | |
Pushes the GIL release one loop outward. First test for these functions (!).
Incorporates suggestions by @jaimefrio and @charris.
|
|/
|
|
| |
numpy.lib._iotools.StringConverter.upgrade should have a return value
|
| |
|
|\
| |
| |
| | |
Update to average calculation
|
| |
| |
| |
| | |
closes gh-5202
|
|\ \
| | |
| | | |
BUG: copy inherited masks in MaskedArray.__array_finalize__
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously, operations which created a new masked array from an old
masked array -- e.g., np.empty_like -- would tend to result in the new
and old arrays sharing the same .mask attribute. This leads to
horrible brokenness in which writes to one array affect the other. In
particular this was responsible for part of the brokenness that
@jenshnielsen reported in gh-5184 in which np.gradient on masked
arrays would modify the original array's mask.
This fixes the worst part of the issues addressed in gh-3404, though
there's still an argument that we ought to deprecate the mask-copying
behaviour entirely so that empty_like returns an array with an empty
mask. That can wait until we find someone who cares though.
I also applied a small speedup to np.gradient (avoiding one copy);
previously this inefficiency was masking (heh) some of the problems
with masked arrays, so removing it is both an optimization and makes
it easier to test that things are working now.
|
|\ \ \ |
|
| |\ \ \
| | |/ /
| | | | |
BUG: fix nanmedian on arrays containing inf
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
There are two issues:
A masked divide of an infinite value is a masked value which means one
can't use np.ma.mean to compute the median as infinity division is well
defined.
This behaviour seems wrong to me but it also looks intentional so
changing it is not appropriate for a bugfix release.
The second issue is that the ordering of the sorted masked array is
undefined for equal values, the sorting considers infinity the largest
floating point value which is not correct in respect to sorting where
nan is considered larger. This is fixed by changing the
minimum_fill_value to nan for float data in the masked sorts.
Closes gh-5138
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Previous expected behavior was that the gradient is computed using central
differences in the interior and first differences at the boundaries.
* gradient was updated in v1.9.0 so that second-order accurate calculations are
done at the boundaries, but this breaks expected behavior with old code, so
`edge_order` keyword (Default: 1) is added to specify whether first or second
order calculations at the boundaries should be used.
* Since the second argument is *varargs, in order to maintain compatibility
with old code and compatibility with python 2.6 & 2.7, **kwargs is used, and
all kwargs that are not `edge_order` raise an error, listing the offending
kwargs.
* Tests and documentation updated to reflect this change.
* Added `.. versionadded:: 1.9.1` to the new optional kwarg `edge_order`
documentation, and specified supported `edge_order` kwarg values.
* Clarified documentation for `varargs`.
* Made indentation in docstring consistent with other docstring styles.
* Examples corrected
|
| |\ \
| | |/
| | | |
Fix npz header incompatibility
|
| | | |
|
| |\ \
| | |/
| | |
| | | |
BUG: Make numpy import when run with Python flag '-OO
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This consists of checking for a docstring equal to None and skipping two
tests that require docstrings.
Closes #5148.
|
|/ / |
|
|\ \
| | |
| | | |
ENH: add subok flag to stride_tricks (and thus broadcast_arrays)
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Closes #5096. Casts integer arrays to np.double, to prevent
integer overflow. Object arrays are left unchanged, to allow
use of arbitrary precision objects.
|
| | |
| | |
| | |
| | |
| | | |
The call to `empty_like` was trying to use the `chararray` subclass,
which doesn't support the `np.intp` dtype.
|
|\ \ \
| | | |
| | | | |
BUG: Fix np.insert for inserting a single item into a structured array
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Note that there are some object array special cases because of allowing
multiple inserts. `np.array(..., dtype=object)` is not always clear.
|
|\ \ \ \
| |/ / /
| | | |
| | | | |
BUG: fix genfromtxt check of converters when using usecols
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
fixes an issue reported by Adrian Altenhoff where user-supplied
converters in genfromtxt were not tested with the right first_values
when also specifying usecols.
|
|\ \ \ \
| |_|/ /
|/| | | |
Use tempdir for large file
|
| | | |
| | | |
| | | |
| | | | |
nobody knows if it supports sparse filesystems, so just skip it.
|
| | | |
| | | |
| | | |
| | | | |
NamedTemporaryFile files can't be reopened on Windows.
|
|\ \ \ \
| | |/ /
| |/| | |
BUG: don't overwrite input percentile arrays
|
| | |/
| |/| |
|