| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This ensures graceful handling of large header files. Unfortunately,
it may be a bit inconvenient for users, thus the new kwarg and the
work-around of also accepting allow-pickle.
See also the documation here:
https://docs.python.org/3.10/library/ast.html#ast.literal_eval
|
|\ \ \
| | | |
| | | | |
ENH: allow NumPy created .npy files to be appended in-place
|
| | | | |
|
| | | | |
|
| |_|/
|/| |
| | |
| | |
| | | |
Explicitly state that only single-character delimiters
are supported.
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some BaseExceptions (at least the Skipped that pytest uses) need to
be caught as well. It seems easiest to be practical and keep ignoring
almost all exception in this particular code path.
Effectively reverts parts of gh-19393
Closes gh-22345
Co-authored-by: Sebastian Berg <sebastianb@nvidia.com>
|
|\ \
| | |
| | | |
DOC: fixed two more typos in docstrings
|
| |/
| |
| | |
nanpercentile and nanquantile had the same typo I just fixed in percentile
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* DOC: Make converters param description more concise.
A wording proposal to hopefully make the description of the
converters parameter of loadtxt more clear, and direct readers
to the example section.
* DOC: Combine both suggestions for param descr.
|
|/ |
|
|\
| |
| | |
DOC: updated the description for array-like type in histogramdd (#19823)
|
| | |
|
|\ \
| | |
| | | |
TST: add functional tests for kron
|
| |/ |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Currently the location of the function definition is always reported
to be `numpy.lib.utils`; this changes it to be the location of the
actual definition when possible.
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since Python 3.8, the default start method for multiprocessing has been changed from fork to spawn on macOS
The default start method is still fork on other Unix platforms[1], causing inconsistency on memory sharing model
It will cause a memory-sharing problem for the test test_large_zip on macOS as the memory sharing model between spawn and fork is different
The fix
Change the start method for this test back to fork under this testcase context
In this test case context, the bug that caused default start method changed to spawn for macOS will not be triggered
It is context limited, so this change will not affect default start method other than test_large_zip
All platforms have the same memory sharing model now
After the change, test_large_zip is passed on macOS
https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods
Closes gh-22203
|
|\
| |
| | |
BUG: fix np.average for Fraction elements
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
1. Information is derived with the help of `threadpoolctl` library.
2. In case `threadpoolctl` is not installed, a message is displayed
with help on how to install it.
3. SIMD related information is derived from `__cpu_features__`,
`__cpu_baseline__` and `__cpu_dispatch__`
|
|/
|
|
| |
Co-authored-by: deego <deego3@gmail.com>
|
|
|
|
|
|
|
|
|
| |
The lerp test compared the output of the original and the symmetric
functions by using basic assertion. Double precision errors could
accumulate in a way that the 2 outputs mismatch by epsilon.
For more information on the precision issue, see #22073
Fix: use assert_allclose instead for float comparison.
|
| |
|
|
|
|
| |
This reverts commit 8cd6f4ca00b6e0da3833fc267d50067b2ddbc069.
|
| |
|
|
|
|
|
|
| |
* if you believe the comments that this warning suppression
should be safe to remove after `1.16`, then it should
be safe to remove now?
|
|
|
|
|
|
| |
This enables any ufunc numpy operations that are called on a
MaskedArray to use the masked version of that function automatically
without needing to resort to np.ma.func() calls.
|
| |
|
| |
|
|\
| |
| | |
ENH: Adding __array_ufunc__ capability to MaskedArrays
|
| |
| |
| |
| |
| |
| | |
This enables any ufunc numpy operations that are called on a
MaskedArray to use the masked version of that function automatically
without needing to resort to np.ma.func() calls.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
and percentile().
Fix the interpolation formulae in the docs which led to absurd results. For quantile() and percentile().
Example, for median of a = [1,2,10,11], you expect to obtain i+g=2.5 for method = linear (or weibull, or hazen, or median_unbiased or normal_unbiased).
Instead, you obtain a /negative/ index.
The correted formula is:
i + g = q * (n - alpha - beta + 1 ) + alpha
Notice among other things that n belongs in the numerator, not the denominator!
As a check, the corrected formula does lead to the correct index 2.5 for each of the cases above.
MYSTERY: Surely the original formula was the result of a small typo/thinko? Then, why does the correction look so completely different?
RESOLUTION OF MYSTERY:
Take our formula, massage it, and swap q with (i+g), and you end up with the original formula.
In other words, the original author of the doc. simply confused their percentile with their index halfway through the creation of the doc. Then, they massaged it to isolate (i+g) on the left.
|
|/
|
|
| |
Also add an example to illustrate how usecols can be used
to read a file with varying number of fields.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR fixes the issue discussed on #12065 and #21843 where 'timedelta64' was noted to be a subtype of numpy.integer. This in principle should detect any cases where int(np.min(ar2)) fails. This PR also adds unittests for these.
* TST: Create in1d test for timedelta input
* MAINT: fix in1d for timedelta input
* TST: in1d raise ValueError for timedelta input
* MAINT: Clean up type checking for isin kind="table"
* TST: Add test for mixed boolean/integer in1d
* MAINT: Increase readability of in1d type checking
* STY: Apply small code style tweaks
This is probably really mainly my personal opinion...
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
|\
| |
| | |
ENH,MAINT: Improve and simplify scalar floating point warnings
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This makes the scalar operations warnings read e.g.:
overflow encountered in scalar multiply
rather than:
overflow encountered in float_scalars
It also fixes one case where "assignment" rather than "cast" was
used when I added the FPEs for casts.
Otherwise, uses the helper that I intrudced for for the floating
point casts in all places to simplify the code, the only
"complicated" thing is that I try to give "scalar divide" rather
than "scalar true_divide" as warnings, since "true_divide" should
not really be something that end-users need be aware of.
|
|/
|
|
|
|
|
|
| |
Non integer array-likes were not correctly rejected when a new
fast-path was added to `np.delete` in gh-16895.
This includes the _explicitly_ added `dtype=object` which should
not be allowed since it is not allowed in normal indexing either.
Closes gh-21840
|
|
|
|
|
| |
* DOC: mention changes to `max_rows` behaviour
* Clarify how line counting works in max_rows
|
|
|
|
|
|
|
|
|
| |
(#21851)
The keepdims flag needs to be applied during the calculation of the sum of
the weights in np.average and np.ma.average. Not passing it causes weights
to broadcast incorrectly.
Fixes #21850
|
|\
| |
| | |
API: Introduce optional (and partial) NEP 50 weak scalar logic
|
| | |
|
| |
| |
| |
| |
| |
| | |
Promotion in percentile will now more aggressively preserve the
input dtype for floating point types (rather than upgrading the
type to at least float64).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* TST: Tests empty input to in1d of various types
* MAINT: Skip table method on empty input array
* MAINT: Check array size before call to min
* MAINT: Return early for kind="table" and empty ar2
* TST: Test other dtypes of empty arrays
|
|\ \
| | |
| | | |
MAINT: Optimize np.isin and np.in1d for integer arrays
|
| | | |
|
| | | |
|
| | | |
|