summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: lib: Use a consistent PEP8-compliant import style in twodim_base.py ↵Warren Weckesser2013-11-022-10/+16
| | | | and tests/test_twodim_base.py. Also make a couple more PEP8 tweaks.
* MAINT: lib: Add a 'See Also' section to the vander docstring, and make a few ↵Warren Weckesser2013-11-021-3/+7
| | | | more PEP8 tweaks.
* MAINT: lib: remove unused imports and PEP8 clean up in twodim_base.pyWarren Weckesser2013-11-021-7/+18
|
* ENH: lib: Rewrite vander: make it faster, and add an option to specify the ↵Warren Weckesser2013-11-022-15/+69
| | | | order of the powers (either decreasing or increasing).
* MAINT: Don't use 'import *' in lib/test_twodim_base.py.Warren Weckesser2013-11-021-1/+3
|
* MAINT: io: handle a bad fmt argument in savetxt by raising a ValueError.Warren Weckesser2013-10-202-0/+6
|
* BUG: cov/corrcoef complex input and empty arraysJoseph Martinot-Lagarde2013-10-162-27/+71
| | | | | | | | | | | | | | | | | This preserves the complex (and higher precision float or object) type of the input array, so that the complex covariance and correlation coefficients can be calculated. It also fixes the the behaviour of empty arrays. These will now either result in a 0x0 result, or a NxN result filled with NaNs. A warning is now issued when ddof is too large and the factor set to 0 so that in this case the result is always NaN or infinity/negative infinity and never a negative number. Closes gh-597 and gh-2680 Closes gh-3882 (original pull request)
* BUG: close file-like objects returned by urlopencgohlke2013-10-151-0/+2
| | | Fix `ResourceWarning: unclosed file` on Python 3
* Merge pull request #3820 from juliantaylor/microoptCharles Harris2013-10-142-1/+2
|\ | | | | A couple micro optimizations
| * TST: improve test speedJulian Taylor2013-09-282-1/+2
| | | | | | | | | | | | | | move slow test_memmap_roundtrip to slow tests decrease excessively large array size used in np.sin(x) compuation TestInterp.test_if_len_x_is_small, the code has no special path for this large size differences.
* | Merge pull request #3862 from juliantaylor/null-freenjsmith2013-10-111-12/+4
|\ \ | | | | | | MAINT: accept NULL in NpyIter_Deallocate and remove redundant NULL checks
| * | MAINT: accept NULL in NpyIter_Deallocate and remove redundant NULL checksJulian Taylor2013-10-031-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | Deallocation should just do nothing if provided a NULL pointer nditer deletion broke this convention. Removed many redundant NULL checks for various deallocation functions used in numpy, they all end up in standard C free or PyMem_Free which are both NULL safe.
* | | Merge pull request #3829 from jarondl/pep8-npyioCharles Harris2013-10-101-59/+53
|\ \ \ | | | | | | | | STY: pep8 for npyio
| * | | STY: pepe8 for npyio continued 2 (typo)Yaron de Leeuw2013-10-111-1/+1
| | | | | | | | | | | | | | | | fixing one typo in npyio.py
| * | | STY: pep8 for npyio continuedYaron de Leeuw2013-10-061-7/+4
| | | | | | | | | | | | | | | | Two slight style modifications in npyio, regarding line length.
| * | | STY: pep8 for npyioYaron de Leeuw2013-09-291-60/+57
| | | | | | | | | | | | | | | | | | | | | | | | Various pep8 fixes for npyio.py Also reorganized the imports, and removed the unnecessary (I hope) `_string_like = _is_string_like` statement.
* | | | TST: Raise AssertionError on failureJoseph Martinot-Lagarde2013-10-101-0/+2
| | | |
* | | | TST: Regression test for gh-2561Joseph Martinot-Lagarde2013-10-091-0/+14
| | | |
* | | | BUG: Disable check for oldstyle classes in python3Joseph Martinot-Lagarde2013-10-091-1/+4
| | | | | | | | | | | | | | | | Fixes gh-2561
* | | | Merge pull request #3769 from juliantaylor/percentile-compatseberg2013-10-052-24/+182
|\ \ \ \ | | | | | | | | | | BUG: ensure percentile has same output structure as in 1.8
| * | | | BUG: ensure percentile has same output structure as in 1.8Julian Taylor2013-10-042-24/+182
| | |/ / | |/| | | | | | | | | | | | | | | | | | percentile returned scalars and lists of arrays in 1.8 adapt new percentile to return scalar and arrays with q dimension first for compatibility.
* | | | BUG: Refactor nanfunctions to behave as agreed on for 1.9.Charles Harris2013-10-042-210/+343
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deal with subclasses of ndarray, like pandas.Series and matrix. Subclasses may not define the new keyword keepdims or deal gracefully with ufuncs in all their forms. This is solved by throwing the problem onto the np.sum, np.any, etc. functions that have ugly hacks to deal with the problem. Settle handling of all-nan slices. nanmax, nanmin -- Raise warning, return NaN for slice. nanargmax, nanargmin -- Raise ValueError. nansum -- Return 0 for slice. nanmean, nanvar, nanstd -- Raise warning, return NaN for slice. Make NaN functions work for scalar arguments. This may seem silly, but it removes a check for special cases. Update tests Deal with new all-nan handling. Test with matrix class as example of subclass without keepdims. Test with scalar arguments. Fix nanvar issue reported in #3860. Closes #3860 #3850
* | | BUG: preserve ndarray subclasses in medianJulian Taylor2013-10-022-1/+14
|/ / | | | | | | closes gh-3846
* | Merge pull request #3638 from charris/remove-numarray-and-oldnumericCharles Harris2013-09-282-51/+59
|\ \ | |/ |/| Remove numarray and oldnumeric
| * DEP, MAINT: Copy info function from numarray.Charles Harris2013-09-231-47/+55
| | | | | | | | | | | | The numarray info function is called by lib.utils.info. Rename it to _info and copy into lib/utils.py. Some modifications are made as it only needs to support numpy.
| * DEP, MAINT: Remove references to numeric and numarray.Charles Harris2013-09-231-4/+4
| | | | | | | | | | This covers those locations that either import or build numarray or numeric.
* | Merge pull request #3775 from jarondl/doc-function_base-pep8Charles Harris2013-09-261-212/+276
|\ \ | | | | | | STY: make function_base.py pep8 compatible
| * | STY: error and warning formatting on 'function_base.py'Yaron de Leeuw2013-09-241-18/+25
| | |
| * | STY: Error and warning newline standardization in function_base.pyYaron de Leeuw2013-09-241-130/+158
| | | | | | | | | | | | | | | Continueing the pep8 effort, adds newline afer each `Error(` and tries to wrap correctly.
| * | STY: make function_base.py pep8 compatibleYaron de Leeuw2013-09-221-175/+204
| | | | | | | | | | | | | | | | | | This makes function_base.py almost pep8 compatible. ALSO, removes the Set import which is unneeded since python 2.4, and organises the import statements.
* | | fix two typos in npyio.pyValentin Haenel2013-09-261-2/+2
| |/ |/|
* | Merge pull request #3753 from jarondl/fix-doc-savetxtCharles Harris2013-09-211-13/+14
|\ \ | |/ |/| DOC: Fixes in the npyio documentation
| * DOC STY: make npyio docstrings less than 80 charsYaron de Leeuw2013-09-211-6/+6
| |
| * small typoYaron de Leeuw2013-09-151-1/+1
| |
| * Fixes in the npyio documentationYaron de Leeuw2013-09-151-11/+12
| | | | | | | | | | | | | | Fixes the "see also" section of savetxt, which described savez as compressing (closes #587 ). Also replaces all occurences of .npy and .npz to use double backticks. Some had, some did not, and some had " symbols.
* | Merge pull request #3658 from jjhelmus/percentile_enh_newJulian Taylor2013-09-192-84/+190
|\ \ | |/ |/| ENH: percentile function with additional parameters and vectorization
| * TST: note on overwrite_input parameter in percentileJonathan Helmus2013-09-162-2/+13
| | | | | | | | | | | | | | * added note that `overwrite_input` has not effect when `a` is not an array in the percentile function. * added unit test to verify that no error is raised when `a` is not an array and `overwrite_input` is True.
| * MAINT: changed 'closest' interpolation to 'nearest'Jonathan Helmus2013-09-162-7/+7
| |
| * TST: additional test for percentileJonathan Helmus2013-09-131-0/+3
| |
| * DOC: changes to scoreatpercentile docstring, doc test now passesJonathan Helmus2013-09-131-18/+20
| |
| * MAINT: cleaning up percentile function.Jonathan Helmus2013-09-132-52/+21
| |
| * ENH: percentile function with additional parameters and vecorizationJonathan Helmus2013-09-132-86/+207
| | | | | | | | | | | | | | The percentile function was enhanced by adding limit and interpolation parameters to give it similar functionality to SciPy's stats.scoreatpercentile function. In addition the function was vecorized along q and rewritten to use the partition method for better performance.
* | DOC: Make documentation of nansum current with 1.9.Charles Harris2013-09-141-2/+2
|/ | | | | Simply state that Numpy versions < 1.9 returned nan instead of zero for the sum of empty slices.
* BUG: Fix 0-sized ndindexSebastian Berg2013-09-092-1/+6
| | | | | | | The zerosize_ok flag to nditer was missing, so that it did not allow for 0-sized iteration. Closes gh-3714
* TST: add test for Python 3.4 _ast.NameConstantChristoph Gohlke2013-09-081-0/+4
|
* ENH: add support for Python 3.4 ast.NameConstantChristoph Gohlke2013-09-081-0/+3
|
* ENH: Improve accuracy of numpy.gradient at edgesdanieljfarrell2013-09-072-25/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * numpy.gradient has been enhanced to use a second order accurate one-sided finite difference stencil at boundary elements of the array. Second order accurate central difference are still used for the interior elements. The result is a fully second order accurate approximation of the gradient over the full domain. * The one-sided stencil uses 3 elements each with a different weight. A forward difference is used for the first element, dy/dx ~ -(3.0*y[0] - 4.0*y[1] + y[2]) / (2.0*dx) and backwards difference is used for the last element, dy/dx ~ (3.0*y[-1] - 4.0*y[-2] + y[-3]) / (2.0*dx) * Because the datetime64 datatype cannot be multiplied a view is taken of datetime64 arrays and cast to int64. The gradient algorithm is then applied to the view rather than the input array. * Previously no dimension checks were performed on the input array. Now if the array size along the differentiation axis is less than 2, a ValueError is raised which explains that more elements are needed. If the size is exactly two the function falls back to using a 2 point stencil (the old behaviour). If the size is 3 and above then the higher accuracy methods are used. * A new test has been added which validates the higher accuracy. Old tests have been updated to pass. Note, this should be expected because the boundary elements now return different (more accurate) values.
* Merge pull request #3657 from charris/add-hash-method-to-polynomialsCharles Harris2013-09-041-0/+2
|\ | | | | BUG: Set __hash__ = None for non-hashable classes.
| * BUG: Set __hash__ = None for non-hashable classes.Charles Harris2013-08-281-0/+2
| | | | | | | | | | | | | | | | | | | | Because neither poly1d nor the Polynomial package polynomial classes are immutable, hence not reliably hashable, they should signal that by setting __hash__ = None. This also fixes the warning Overriding __eq__ blocks inheritance of __hash__ in 3.x that is given when the command `python2.7 -3 -c"import numpy"` is run.
* | STY: Make numpy/lib/test/*.py PEP8 compliant.Charles Harris2013-09-0319-1086/+1246
| | | | | | | | | | | | | | Run autopep8 over the test files in numpy/lib/test and make fixes to the result. Also remove Python5 workaround.