summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | 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.
* | BUG: Make DeprecationWarning always raise error in test.Charles Harris2013-08-311-3/+5
| | | | | | | | | | | | The test_fancy in numpy/lib/tests/test_function_base.py failed in release because a DeprecationWarning was no longer raised, it had become a warning.
* | Small correction in the docstring of polyfit. As mentionned in Issue 3640, ↵Matthieu Dartiailh2013-08-251-3/+3
|/ | | | the notes were wrong in the order of the index for p.
* DEP: Make nansum return 0 for all-NaN or empty axis.Charles Harris2013-08-182-39/+12
| | | | | Make this happen and remove test parts dependent on numpy version < 1.9. Fixes test failures in numpy after 1.8 branch.
* STY: Giant comma spacing fixup.Charles Harris2013-08-1831-875/+875
| | | | | | | Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long and will need to be broken at some point. OTOH, some lines were already too long and need to be broken at some point. Now seems as good a time as any to do this with open PRs at a minimum.
* STY: Giant whitespace cleanup.Charles Harris2013-08-184-4/+3
| | | | Now is as good a time as any with open PR's at a low.
* BUG: fix np.median so it accepts array_like input. Clean up median tests.Ralf Gommers2013-08-172-56/+74
|
* TST: Test that savetxt works with objects having a write method.Daniel2013-08-151-0/+12
|
* ENH: Make savetxt work with file like objects.Daniel2013-08-151-1/+1
| | | | | Accept any object with a "write" method as that is the only method called by the code.
* DOC: Various fixes.Charles Harris2013-08-142-19/+18
| | | | | | Fix typos and clarify some explanations. Document the changes in the return values of nanargmin and nanargmax for all-NaN slices in the 1.8.0 release notes.
* TST: Add tests for the nansum, nanmean, nanvar, and nanstd.Charles Harris2013-08-121-190/+367
|
* MAINT: Refactor nanfunctions.Charles Harris2013-08-121-333/+468
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nanmax, nanmin -------------- Add out and keepdims keywords. nanargmin, nanargmax -------------------- A NanWarning is raised if an all NaN slice detected. For all such slices np.iingo(np.intp).min is returned as the index value. nansum ------ The keywords dtype, out, and keepdims are added. A FutureWarning is raised, as in the future the mean of an empty slice after NaN replacement will be 0 instead of the current NaN. nanmean, nanvar, nanstd ----------------------- For all, if the input array is of inexact type then the dtype and out parameters must be of inexact type if specified. That insures that NaNs can be returned when appropriate. The nanmean function detects empty slices after NaN replacement and raises a NanWarning. NaN is returned as the value for all such slices. The nanmean and nanstd functions detect degrees of freedom <= 0 after NaN replacement and raise a NanWarning. NaN is returned as the value for all such slices.
* MAINT: Separate nan functions into their own module.Charles Harris2013-08-125-463/+935
| | | | | | | | | | | | | | New files lib/nanfunctions.py and lib/tests/test_nanfunctions.py are added and both the previous and new nan functions and tests are moved into them. The existing nan functions moved from lib/function_base are: nansum, nanmin, nanmax, nanargmin, nanargmax The added nan functions moved from core/numeric are: nanmean, nanvar, nanstd
* ENH: implement median in terms of partitionJulian Taylor2013-08-122-12/+79
| | | | | | Partitioning is sufficient to obtain the median and is much faster. In the case of overwrite_input=True the resulting array will not be fully sorted anymore.