summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
...
| * DOC: Add warning message to np.npv docskai-striega2019-09-141-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``np.npv`` calculates the present value of a series of cashflows starting in the present (t=0). Another common definition of NPV uses the future cashflows i.e. starting at the end of the first period. The difference in definition can lead to confusion for users moving between NumPy and other projects [1] and adds complexity for maintainers [2]. This commit adds a warning to the ``npv`` function's documentation and adds an example on how to find the npv of a project using the alternate definition. [1] https://github.com/numpy/numpy/issue/10877 [2] https://github.com/numpy/numpy/pull/3346
* | Merge pull request #14255 from hgt312/fix_uniqueSebastian Berg2019-09-122-4/+8
|\ \ | | | | | | BUG: fix inconsistent axes ordering for axis in function `unique`
| * | add description in docstringHuang, Guangtai2019-08-211-0/+1
| | |
| * | fix uniqueHuang, Guangtai2019-08-132-4/+7
| | |
* | | Merge pull request #14209 from lagru/fix-linear-rampCharles Harris2019-09-052-76/+41
|\ \ \ | | | | | | | | BUG: Fix uint-overflow if padding with linear_ramp and negative gain
| * | | BUG: Replace _linear_ramp with linspaceLars Grueter2019-08-272-76/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | linspace supports non-scalar values since version 1.16. This can replace the former _linear_ramp method. This removes a bug in the old implementation where certain edge and end values resulted in an integer underflow for unsigned dtypes (see gh-14191). Protect against this regression with a new test for all numeric dtypes.
* | | | Merge pull request #14365 from WarrenWeckesser/doc-averageMatti Picus2019-08-271-2/+5
|\ \ \ \ | | | | | | | | | | DOC: lib: Add more explanation of the weighted average calculation.
| * | | | DOC: lib: Add more explanation of the weighted average calculation.Warren Weckesser2019-08-261-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Also removed the incorrect comment from the docstring of `numpy.ma.average` about the imaginary part of `weights` being ignored.
* | | | | Merge pull request #14370 from ivirshup/var-dtype-docfixMatti Picus2019-08-271-1/+1
|\ \ \ \ \ | |/ / / / |/| | | | DOC: Fixed dtype docs for var, nanvar.
| * | | | DOC: Fixed dtype docs for var, nanvar.Isaac Virshup2019-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Docs incorrectly stated that the default output dtype was float32 when input array is of an integer dtype. However: ```python np.var(np.random.randint(0, 100, 1000)).dtype == np.dtype("f8") ```
* | | | | DEP: Deprecate class `SafeEval` (#14335)Maxwell Aladago2019-08-241-87/+0
| | | | | | | | | | | | | | | | | | | | * Deprecate class SafeEval
* | | | | Merge pull request #14310 from ahaldane/fix_struct_to_unstruct_nestingCharles Harris2019-08-232-8/+75
|\ \ \ \ \ | | | | | | | | | | | | MAINT: Fix behavior of structured_to_unstructured on non-trivial dtypes
| * | | | | MAINT: fix behavior of structured_to_unstructured on non-trivial dtypesAllan Haldane2019-08-232-8/+75
| | |_|_|/ | |/| | | | | | | | | | | | | Fixes #13333
* | | | | Merge remote-tracking branch 'upstream/master' into fix-if-fieldsEric Wieser2019-08-1939-2514/+3074
|\ \ \ \ \ | |/ / / /
| * | | | DOC:Add example to clarify "numpy.save" behavior on already open file #10445 ↵Omar Merghany2019-08-161-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | (#14070) * DOC:Add example to clarify "numpy.save" behavior on already unclosed file
| * | | | Merge pull request #14101 from lagru/zero_stat_lengthSebastian Berg2019-08-152-1/+31
| |\ \ \ \ | | | | | | | | | | | | MAINT: Clearer error message while padding with stat_length=0
| | * | | | MAINT: Clearer error while padding stat_length=0Lars Grueter2019-08-092-1/+31
| | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provides a clearer error message if stat_length=0 is the cause of an exception (mean and median return nan with warnings) as well as tests covering this behavior. Note: This shouldn't change the behavior/API except for the content of the raised ValueError.
| * | | | fixes StopIteration error for empty file with skip_header > 0Maxwell Aladago2019-08-112-5/+10
| | |_|/ | |/| |
| * | | DOC: new nan_to_num keywords are from 1.17 onwards (#14219)Géraud Le Falher2019-08-081-1/+9
| |/ / | | | | | | * DOC: new nan_to_num keywords are from 1.17 onwards
| * | DOC: fix documentation of i and j for tri.hvy2019-07-241-1/+1
| | |
| * | Add blank line above doctest for intersect1dJackie Leng2019-07-231-0/+1
| | |
| * | Merge pull request #14063 from luispedro/fix_save_duck_checkCharles Harris2019-07-222-2/+40
| |\ \ | | | | | | | | BUG: Fix file-like object check when saving arrays
| | * | TST Test file-like object detection in save/loadLuis Pedro Coelho2019-07-201-0/+38
| | | |
| | * | BUG: Fix file-like object check when saving arraysLuis Pedro Coelho2019-07-201-2/+2
| | | | | | | | | | | | | | | | For writing arrays, only the ``write`` method is necessary.
| * | | Merge pull request #13964 from colinsnyder/add-recfunctionsCharles Harris2019-07-222-44/+44
| |\ \ \ | | |/ / | |/| | BUG, DOC: add new recfunctions to `__all__`
| | * | fixed unstructured_to_structured in recfunctionsColin Snyder2019-07-202-7/+13
| | | |
| | * | Removed unnecessary decorators and dispatcher functionsColin Snyder2019-07-151-15/+0
| | | |
| | * | exported correct functions and made private the restColin Snyder2019-07-142-30/+34
| | | |
| | * | add new recfunctions to __all__Colin Snyder2019-07-101-11/+16
| | | |
| * | | DEP: Speed up WarnOnWrite deprecation in buffer interfaceSebastian Berg2019-07-161-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a buffer interface does not request a writeable buffer, simply pass a read-only one when the warn on write flag is set. This is to give an easier way forward with avoiding the deprecation warnings: Simply do not ask for a writeable buffer. It will break code that expects writeable buffers but does not ask for them specifically a bit harder than would be nice. But since such code probably should ask for it specifically, this is likely fine (an RC release has to find out). The main reason for this is, that this way it plays very will with cython, which requests writeable buffers explicitly and if declared `const` is happy about read-only (so that using `const` is the best way to avoid the warning and makes code cleaner). Closes gh-13929, gh-13974
| * | | DOC: Change (old) range() to np.arange()Dieter Werthmüller2019-07-111-3/+3
| |/ / | | | | | | I think it should be like that (maybe I am mistaken).
| * | DOC: add space between words across linesmattip2019-07-101-1/+1
| | |
| * | BUG: i0 Bessel function regression on array-likes supporting ufuncsSebastian Berg2019-07-042-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For array likes supporting UFuncs, `np.abs` would return an array-like, and this is currently not compatible with the use of `np.piecewise`. The simplest fix seems to be to just call asanyarray (which piecewise calls anyway on the array) beforehand. This way we ensure the conditions are also an array. Fixes gh-13894
| * | BUG: Refcount fixes (#13860)Sebastian Berg2019-07-031-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * BUG: Fix leaking of object descriptor on dtype discovery of `None` * BUG: Fix reference count leak in string discovery code path * BUG: Fix two more datetime related reference count bugs One is leaking only the python integer 1, the other a descriptor. * BUG: Fix bugs in vectorized string functions error paths Fixes reference count issues (a leak) in TestVecString::test_non_existent_method and TestVecString::test_non_string_array * BUG: Fix Reference count leak in in128 C-level tests * BUG: Fix refcount leak in advanced indexing error path * BUG,MAINT: Refactor indexing dtypes handling in mapiter constructor Using borrowed references for the dtypes seems much easier to get the reference counts right. * BUG: Reference leaks in deprecated datetime with timezone coercion * BUG: Refcount issue in nonzero 0-d path * BUG: Fix ufunc.at dtype refcount handling in resolver * BUG: Fix reference count in nditer python op_axes setup * BUG: Reference leak in writebackifcopy non-array error path * BUG: Add missing DECREF in ufunc with dtype type resolution * BUG: Reference count bugs in io functions * BUG: Reference count loss in as_c_array C-side tests * BUG: Leaking of method in object method based ufunc loops The function could possibly be optimized nicely by checking that the method will be the same because the types are identical. OTOH, that may not be correct in dynamically adapted types. * TST: Clean up cyclic ctypes reference to simplify leak debugging If we do not clean it up in this test, the collection can take so long that it affects the following tests when running with reference leak debugging tools (pytest-leaks). * BUG: Reference count of raw data for 0-sized unpickling * TST: Mark tests which must leak references It really may be time to remove this, considering how annoying this is, may want to think about getting rid of that behaviour. Could probably write a multiearraytests C-side function instead. * BUG: Fix refcount leaks in arr.getield and setfield error paths * BUG: Fix refcount issue in wheremask This fix is not the prettiest, since it relies on the wheremask to be formatted to boolean beforehand correctly. * TST: Reset StringConvert after mutating it in tests Or maybe just mark the test? * BUG: Fix missing static for npy_cache_import in umath funcs.inc.src * BUG: Fix refcount in multiternew error path * BUG: Fix npy_ObjectGCD and LCM reference counting * BUG: Decrement already wrapped outputs on failure This is not super pretty, but not sure how to do it much better right now. * FIXUP: iotools StringConverter._mapper * FIXUP: as_c_array tests * FIXUP: String/dtype discovery comment * FIXUP: Nonzero comment * FIXUP: mapiternew -- check error return of dtype creation In principle, at least at this time, this is not possible
| * | MAINT: Replace integers in places where booleans are expectedMSeifert042019-07-014-14/+14
| | |
| * | ENH: Deprecate writeable broadcast_array (#12609)Matti Picus2019-06-282-11/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the base is not an array (or generally when the flag of the base array was toggled), it is OK to allow setting the writeable flag to True, as long as any ancestor (especially the last one) is writeable. This commit also slightly change the behaviour of the base attribute. --- * ENH: Deprecate writeable broadcast_array * ENH: Make writeable flag enabling more reliable for non-array bases When the base is not an array (or generally when the flag of the base array was toggled), it is OK to allow setting the writeable flag to True, as long as any ancestor (especially the last one) is writeable. * Update doc/release/1.17.0-notes.rst Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net> * Update doc/release/1.17.0-notes.rst Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net> * Update numpy/lib/tests/test_stride_tricks.py Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net> * Update numpy/core/tests/test_multiarray.py Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net> * DOC: improve warning (from review)
| * | Merge branch 'master' into force-zip64Charles Harris2019-06-2615-104/+186
| |\ \
| | * | BUG: further fixup to histogram2d dispatcher.Marten van Kerkwijk2019-06-202-2/+26
| | |/ | | | | | | | | | Now with tests....
| | * Update nanfunctions.pyHe Jia2019-06-141-0/+1
| | |
| | * Update function_base.pyHe Jia2019-06-141-1/+2
| | |
| | * Merge pull request #13757 from shoyer/hist-dispatcherMarten van Kerkwijk2019-06-142-2/+22
| | |\ | | | | | | | | MAINT: fix histogram*d dispatchers
| | | * MAINT: check bins length in histogram2d_dispatcherStephan Hoyer2019-06-111-4/+11
| | | |
| | | * MAINT: spellingStephan Hoyer2019-06-111-1/+1
| | | |
| | | * MAINT: fix histogram*d dispatchersStephan Hoyer2019-06-112-2/+15
| | | | | | | | | | | | | | | | fixes GH-13728
| | * | BUG: ensure i0 does not change the shape.Marten van Kerkwijk2019-06-122-16/+16
| | |/
| | * Merge pull request #13222 from kritisingh1/patch1Matti Picus2019-06-103-58/+80
| | |\ | | | | | | | | DOC: Document/ Deprecate functions exposed in "numpy" namespace
| | | * fix testskritisingh12019-06-072-7/+12
| | | |
| | | * Fix testskritisingh12019-04-102-65/+60
| | | |
| | | * Issue deprecation warningskritisingh12019-04-053-2/+24
| | | |
| | * | BUG: Ensure that the url request is closed if the file cannot be openedEric Wieser2019-06-041-7/+4
| | | |