summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge pull request #5203 from njsmith/masterCharles Harris2014-10-212-3/+14
|\ \ \ | | | | | | | | BUG: copy inherited masks in MaskedArray.__array_finalize__
| * | | BUG: copy inherited masks in MaskedArray.__array_finalize__Nathaniel J. Smith2014-10-212-3/+14
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'master' of https://github.com/numpy/numpy into interp_with_periodsaullogiovani2014-10-1710-134/+169
|\ \ \
| * \ \ Merge pull request #5182 from juliantaylor/nanmedian-infCharles Harris2014-10-161-0/+16
| |\ \ \ | | |/ / | | | | BUG: fix nanmedian on arrays containing inf
| | * | BUG: fix nanmedian on arrays containing infJulian Taylor2014-10-141-0/+16
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | BUG: Fixes #5184 gradient calculation behavior at boundariesDavid M Fobes2014-10-162-22/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * | DEP: Deprecate SafeEval class.Charles Harris2014-10-151-0/+6
| | | | | | | | | | | | The class is no longer used in numpy and was never exported.
| * | MAINT: Use ast.literal_eval in safe_eval.Charles Harris2014-10-151-15/+3
| | | | | | | | | | | | | | | This does what is needed now that the compiler module is no longer used.
| * | Merge pull request #5177 from charris/do-not-use-compiler-moduleJulian Taylor2014-10-151-98/+46
| |\ \ | | | | | | | | MAINT: Remove use of compiler module.
| | * | MAINT: Remove use of compiler module.Charles Harris2014-10-121-98/+46
| | | | | | | | | | | | | | | | | | | | | | | | The ast module was added in Python 2.6 as a replacement for the compiler module. As we no longer support Python versions < 2.6, all uses of the compiler module can be removed.
| * | | Merge pull request #5183 from charris/fix-npy-header-writeJulian Taylor2014-10-151-3/+4
| |\ \ \ | | | | | | | | | | BUG: Fix writing of intrinsic long integers in python2 npy files.
| | * | | BUG: Fix writing of intrinsic long integers in python2 npy files.Charles Harris2014-10-131-3/+4
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This only happens when C long is smaller than npy_intp, in particular, on 64 bit windows. The 'L' suffix is not needed as long as safe_eval is used to recover the values, and the long intrinsic causes problems for python3. The python3 read side has been fixed, but we might as well fix the problem at the root as well.
| * | | Add examples for intersect1d and union1d of more than two arrays.Christian Brueffer2014-10-151-0/+10
| | | | | | | | | | | | | | | | The approach was suggested by Jaime Frio in issue #5179.
| * | | Merge pull request #5178 from charris/fix-npz-header-incompatibilityJulian Taylor2014-10-134-1/+51
| |\ \ \ | | |/ / | | | / | | |/ | |/| Fix npz header incompatibility
| | * TST: Add tests for Python2, Python3 *.npy compatibility.Charles Harris2014-10-123-0/+10
| | |
| | * BUG: Make python2 *.npy files readable in python3.Charles Harris2014-10-121-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Python2 generated file had long integer literals like '1L' that broke in Python3. The fix here is to filter out the 'L' and let safe_eval take care of the integer type in converting the string. The fix here comes from Nathaniel Smith with a few added fixups. Closes #5170.
| * | Merge pull request #5149 from charris/fix-ma-docs-for-OO-optionJulian Taylor2014-10-042-2/+7
| |\ \ | | |/ | | | | | | BUG: Make numpy import when run with Python flag '-OO
| | * BUG: Make numpy import when run with Python flag '-OO'.Charles Harris2014-10-032-2/+7
| | | | | | | | | | | | | | | | | | | | | This consists of checking for a docstring equal to None and skipping two tests that require docstrings. Closes #5148.
* | | ENH: added parameter to use periodic x-coordinatessaullogiovani2014-10-022-8/+68
|/ /
* | Merge pull request #5101 from jaimefrio/digitize_as_searchsortedCharles Harris2014-09-291-160/+77
|\ \ | | | | | | ENH: implement `digitize` with `PyArray_SearchSorted`
| * | ENH: Release GIL in `digitize`jaimefrio2014-09-251-0/+6
| | |
| * | ENH: implement `digitize` with `PyArray_SearchSorted`jaimefrio2014-09-251-160/+71
| | |
* | | Merge pull request #4622 from mhvk/lib/stride_tricks/subclassesseberg2014-09-262-6/+68
|\ \ \ | |/ / |/| | ENH: add subok flag to stride_tricks (and thus broadcast_arrays)
| * | Convert as_strided input to array firstMarten van Kerkwijk2014-08-272-8/+25
| | |
| * | ENH: add subok flag to stride_tricks (and thus broadcast_arrays)Marten van Kerkwijk2014-08-252-6/+51
| | |
* | | ENH: Cast non-object arrays to float in np.polyjaimefrio2014-09-252-6/+23
| | | | | | | | | | | | | | | | | | Closes #5096. Casts integer arrays to np.double, to prevent integer overflow. Object arrays are left unchanged, to allow use of arbitrary precision objects.
* | | BUG: np.unique with chararray + inverse_indexCJ Carey2014-09-232-1/+7
| | | | | | | | | | | | | | | The call to `empty_like` was trying to use the `chararray` subclass, which doesn't support the `np.intp` dtype.
* | | DOC: update numpy.extract docstringGregory R. Lee2014-09-151-1/+3
| | |
* | | Merge pull request #5024 from pp-mo/in1d_of_setJulian Taylor2014-09-131-0/+4
|\ \ \ | | | | | | | | DOC: warn about using a set with 'in1d'.
| * | | DOC: warn about using a set with 'in1d'.Patrick Peglar2014-08-311-0/+4
| | | |
* | | | fix typoGabriel-p2014-09-071-1/+1
| | | |
* | | | MAINT: Make numpy/lib/polynomial/polyval a bit faster.Charles Harris2014-09-021-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | Multiplying a numpy_scalar times a numpy_array is much faster than the other way around. This PR switches the order of multiplication in the polyval function resulting in a speedup of about 5x for scalar values of x. Closes #4610.
* | | Merge pull request #5022 from seberg/structured-insertCharles Harris2014-08-302-2/+14
|\ \ \ | | | | | | | | BUG: Fix np.insert for inserting a single item into a structured array
| * | | BUG: Fix np.insert for inserting a single item into a structured arraySebastian Berg2014-08-302-2/+14
| | | | | | | | | | | | | | | | | | | | Note that there are some object array special cases because of allowing multiple inserts. `np.array(..., dtype=object)` is not always clear.
* | | | Merge pull request #5021 from charris/remove-missing-files-from-setupRalf Gommers2014-08-291-1/+0
|\ \ \ \ | | | | | | | | | | MAINT: Remove references to missing files from install.
| * | | | MAINT: Remove references to missing files from install.Charles Harris2014-08-291-1/+0
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following directories and files have been moved or deleted numpy/lib/benchmarks numpy/f2py/docs numpy/f2py/f2py.1 This PR removes references to them from the relevant setup.py files. Closes #5010.
* | | | ENH: Speed up `unique` with `return_inverse`jaimefrio2014-08-271-2/+3
| | | | | | | | | | | | | | | | This replaces a sort with fancy indexing.
* | | | Merge pull request #5006 from dhomeier/ioconv_usecolsJulian Taylor2014-08-272-6/+24
|\ \ \ \ | | |/ / | |/| | | | | | BUG: fix genfromtxt check of converters when using usecols
| * | | BUG: fix genfromtxt check of converters when using usecolsDerek Homeier2014-08-272-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #5005 from juliantaylor/use-tempdir-for-large-fileJulian Taylor2014-08-271-16/+16
|\ \ \ \ | |_|_|/ |/| | | Use tempdir for large file
| * | | TST: skip large file test on windowsJulian Taylor2014-08-271-0/+2
| | | | | | | | | | | | | | | | nobody knows if it supports sparse filesystems, so just skip it.
| * | | BUG: avoid NamedTemporaryFile for large file testMatthew Brett2014-08-271-16/+14
| | | | | | | | | | | | | | | | NamedTemporaryFile files can't be reopened on Windows.
* | | | Merge pull request #4989 from juliantaylor/percentile-fixCharles Harris2014-08-242-1/+9
|\ \ \ \ | | |/ / | |/| | BUG: don't overwrite input percentile arrays
| * | | BUG: don't overwrite input percentile arraysJulian Taylor2014-08-242-1/+9
| | |/ | |/|
* | | Correct the fill_diagonal exampleshpaulj2014-08-211-2/+5
| | |
* | | BUG: io: genfromtxt did not handle filling_values=0 correctly. Closes gh-2317.Warren Weckesser2014-08-152-1/+13
| | |
* | | Merge pull request #4938 from charris/fix-docstring-typoCharles Harris2014-08-041-1/+1
|\ \ \ | | | | | | | | DOC: Fix typo in _iotools.py docstring.
| * | | DOC: Fix typo in _iotools.py docstring.Charles Harris2014-07-311-1/+1
| |/ / | | | | | | | | | The error is in the StringConverter.upgrade docstring.
* | | Merge pull request #4929 from juliantaylor/charris-pep8-numpy-libCharles Harris2014-07-3139-1209/+1411
|\ \ \ | |/ / | | | Charris pep8 numpy lib
| * | STY: Make files in numpy/lib PEP8 compliant.Charles Harris2014-07-3120-517/+678
| | | | | | | | | | | | The rules enforced are the same as those used for scipy.