summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge pull request #5893 from stefanv/hannNathaniel J. Smith2015-05-181-1/+1
|\ \ | | | | | | DOC: Fix spelling of Von Hann's surname
| * | DOC: Fix spelling of Von Hann's surnameStefan van der Walt2015-05-181-1/+1
| | |
* | | BUG: fix _broadcast_shape (and broadcast_array) for len(args) > 32Stephan Hoyer2015-05-152-0/+9
| | | | | | | | | | | | Fixes gh-5862
* | | MAINT: Simplify code in cov function a bit.Charles Harris2015-05-131-6/+5
| | |
* | | Merge pull request #4960 from tpoole/weighted_covCharles Harris2015-05-132-36/+176
|\ \ \ | | | | | | | | ENH: add a weighted covariance calculation.
| * | | ENH: add 'fweights' and 'aweights' arguments to covariance calculations.tpoole2015-05-132-36/+176
| | | | | | | | | | | | | | | | | | | | 'fweights' allows integer frequencies to be specified for observation vectors, and 'aweights' provides a more general importance or probabalistic weighting.
* | | | Merge pull request #5605 from shoyer/stackCharles Harris2015-05-123-4/+6
|\ \ \ \ | |/ / / |/| | | ENH: add np.stack
| * | | ENH: add np.stackStephan Hoyer2015-05-113-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivation here is to present a uniform and N-dimensional interface for joining arrays along a new axis, similarly to how `concatenate` provides a uniform and N-dimensional interface for joining arrays along an existing axis. Background ~~~~~~~~~~ Currently, users can choose between `hstack`, `vstack`, `column_stack` and `dstack`, but none of these functions handle N-dimensional input. In my opinion, it's also difficult to keep track of the differences between these methods and to predict how they will handle input with different dimensions. In the past, my preferred approach has been to either construct the result array explicitly and use indexing for assignment, to or use `np.array` to stack along the first dimension and then use `transpose` (or a similar method) to reorder dimensions if necessary. This is pretty awkward. I brought this proposal up a few weeks on the numpy-discussion list: http://mail.scipy.org/pipermail/numpy-discussion/2015-February/072199.html I also received positive feedback on Twitter: https://twitter.com/shoyer/status/565937244599377920 Implementation notes ~~~~~~~~~~~~~~~~~~~~ The one line summaries for `concatenate` and `stack` have been (re)written to mirror each other, and to make clear that the distinction between these functions is whether they join over an existing or new axis. In general, I've tweaked the documentation and docstrings with an eye toward pointing users to `concatenate`/`stack`/`split` as a fundamental set of basic array manipulation routines, and away from `array_split`/`{h,v,d}split`/`{h,v,d,column_}stack` I put this implementation in `numpy.core.shape_base` alongside `hstack`/`vstack`, but it appears that there is also a `numpy.lib.shape_base` module that contains another larger set of functions, including `dstack`. I'm not really sure where this belongs (or if it even matters). Finally, it might be a good idea to write a masked array version of `stack`. But I don't use masked arrays, so I'm not well motivated to do that.
* | | | Merge pull request #5847 from christianbrodbeck/fix/setdiff1dJaime2015-05-072-7/+7
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | BUG: setdiff1d return type Fixes 5846
| * | | | BUG: setdiff1d return dtypeChristian Brodbeck2015-05-072-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Fixes #5846 (If called with an empty array as first argument, the returned array had dtype bool instead of the dtype of the input array)
* | | | | DOC: note versionadded for broadcast_toEric Moore2015-05-061-0/+4
|/ / / / | | | | | | | | | | | | closes gh-5839
* | | | Merge pull request #5805 from jaimefrio/ix_intpCharles Harris2015-05-052-11/+39
|\ \ \ \ | | | | | | | | | | Ix intp
| * | | | BUG: Fix handling of non-empty ndarraysJaime Fernandez2015-05-042-11/+17
| | | | |
| * | | | TST: Added tests for ix_Jaime Fernandez2015-04-271-1/+25
| | | | |
| * | | | BUG: make empty inputs to ix_ create an empty int typed outputJaime Fernandez2015-04-271-9/+7
| | |/ / | |/| | | | | | | | | | Fixes #5804
* | | | BUG: fixes segfault in np.place when vals is emptybehzad nouri2015-05-041-0/+8
|/ / /
* | | Merge pull request #4612 from Nodd/loadtxt_commentsCharles Harris2015-04-232-10/+52
|\ \ \ | | | | | | | | ENH: Multiple comment tokens in loadtxt
| * | | ENH: Multiple comment tokens in loadtxtJoseph Martinot-Lagarde2015-04-222-10/+52
| | | |
* | | | ENH: add options for disabling use of pickle in load/savePauli Virtanen2015-04-183-12/+68
| |_|/ |/| |
* | | DOC, MAINT: fix typo in np.insert docstringFrançois Magimel2015-04-131-0/+1
| | |
* | | DOC: Docstring of gradient() functionHelder Oliveira2015-04-091-3/+3
| | | | | | | | | | | | Updating of docstring of gradient() function specifying the return is a `list` of `ndarray`.
* | | Merge pull request #5751 from helderc/patch-1Charles Harris2015-04-051-0/+4
|\ \ \ | | | | | | | | DOC: Return of gradient() function
| * | | DOC: Return of gradient() functionHelder Cesar2015-04-051-0/+4
| | | | | | | | | | | | This is an improve of documentation for gradient() funcion as commented in #5628
* | | | Merge pull request #5713 from cowlicks/bug-5712Charles Harris2015-04-052-13/+55
|\ \ \ \ | |/ / / |/| | | Fix read_array_header_*
| * | | BUG: don't ignore version passed to format.write_arrayBlake Griffith2015-04-051-11/+9
| | | | | | | | | | | | | | | | Previously the passed in version was ignored
| * | | TST: tests for format.read_array_header_* and test read_magicBlake Griffith2015-04-011-0/+44
| | | |
| * | | BUG: Make read_array_header_* return resultsBlake Griffith2015-04-011-2/+2
| |/ / | | | | | | | | | | | | | | | | | | Previously read_array_header_1_0 & read_array_header_2_0 were not returning the documented results. Closes #5602
* | | BUG: Refactor nan_to_num and make list inputs work in Python > 3.2.Charles Harris2015-04-031-34/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also fix the documentation to reflect current behavior 1) Copies of the input are always returned. 2) Type is preserved, in particular, integer is not upcast to float. Note that the function now accepts all types, not just inexact and integer. The lack of upcast is present since at least numpy 1.5, but may be a bug.
* | | TST: Test nan_to_num with integer list input.Charles Harris2015-04-031-0/+2
| | |
* | | BUG: Integer list passed into nan_to_num results in ValueError.jmrosen1552015-04-031-0/+1
|/ / | | | | | | | | | | Fix is to properly set array type. Closes #1478
* | ENH: deprecate bias and ddof arguments to corrcoefMatthew Brett2015-03-152-27/+50
| | | | | | | | | | | | | | The bias and ddof arguments had no effect on the calculation of the correlation coefficient because the value cancels in the calculation. Deprecate these arguments to np.corrcoef and np.ma.corrcoef.
* | Merge pull request #5585 from Kreiswolke/BugFixTileJaime2015-03-122-1/+12
|\ \ | | | | | | BUG: Fixed issue #4679 - make numpy.tile always return a copy
| * | Update shape_base.pyKreiswolke2015-03-111-2/+2
| | | | | | | | | So removed the paranthesis and included the return statement.
| * | BUG: Fixed issue #4679 and added testOliver Eberle2015-02-192-1/+12
| |/ | | | | | | | | Tile now copies the input when it is a numpy array and all dimensions are repeated only once.
* | Merge pull request #5519 from jaimefrio/array_interface_dtypeCharles Harris2015-03-122-2/+27
|\ \ | | | | | | ENH: PyArray_FromInterface checks descr if typestr is np.void
| * | ENH: PyArray_FromInterface checks descr if typestr is np.voidjaimefrio2015-03-082-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the 'typestr' member of the __array_interface__ dictionary defines a np.void dtype, check the 'descr' member, and if it is a valid dtype description and it is not the default one, use it to construct the dtype for the array to return. This fixes #5081, as as_strided no longer has to worry about changing the dtype of the return.
* | | BUG: loadtxt fails with complex data in Python 3.Charles Harris2015-03-112-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that the Python complex type constructor only accepts a pair of numbers or a string, unlike other numeric types it does not work with byte strings. The numpy error is subtle, as loadtxt opens the file in the default text mode, but then converts the input lines to byte strings when they are split into separate values. The fix here is to convert the values back to strings in the complex converter. Closes #5655.
* | | STY: fold long linesPauli Virtanen2015-03-083-10/+14
| | |
* | | BUG: enable working around pickle compatibility issues on Py3 in npy filesPauli Virtanen2015-03-087-15/+146
| | | | | | | | | | | | | | | | | | Add pickle compatibility flags to numpy.save and numpy.load. Allow only combinations that cannot corrupt binary data in Numpy arrays. Use the same default values as Python pickle.
* | | BUG: genfromtxt gave OverflorError for large integersThomas Robitaille2015-03-063-10/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix StringConverter to avoid OverflowError in genfromtxt. Before, int(2**66) would work (and return a ‘long’) but then np.array([2**66], dtype=np.integer) would not work and return an OverflowError which would propagate to genfromtxt. This commit fixes this by ensuring testing in advance whether an OverflowError will occur. In addition, this adds an explicit np.int64 entry on systems where integer means int32. Values larger than 2**63-1 will be cast as float. This includes a regression test and adds an entry to the release notes.
* | | DOC: Reconcile docstrings and function signatures where they disagreeRobert McGibbon2015-03-024-8/+8
| | | | | | | | | | | | | | | Fixed typos in docstrings were updated for functions where the parameter names in the docstring didn't match the function signature.
* | | BUG: fix broadcast_to for reference typesStephan Hoyer2015-03-012-3/+13
| | |
* | | Merge pull request #5619 from jaimefrio/unique_docstringJulian Taylor2015-03-011-3/+4
|\ \ \ | | | | | | | | | | | | DOC: Describe return_counts keyword in np.unique docstring
| * | | DOC: Describe return_counts keyword in np.unique docstringJaime Fernandez2015-03-011-3/+4
| | | |
* | | | BLD: Add mingw-w64 support for the mingw64static option.carlkl2015-02-271-1/+1
| |/ / |/| |
* | | Merge pull request #5371 from shoyer/broadcast_toCharles Harris2015-02-262-57/+192
|\ \ \ | | | | | | | | ENH: add np.broadcast_to and reimplement np.broadcast_arrays
| * | | ENH: add broadcast_to functionStephan Hoyer2015-02-262-57/+192
| | |/ | |/| | | | | | | | | | | | | | | | | | | Per the mailing list discussion [1], I have implemented a new function `broadcast_to` that broadcasts an array to a given shape according to numpy's broadcasting rules. [1] http://mail.scipy.org/pipermail/numpy-discussion/2014-December/071796.html
* | | DOC: fix typos in corrcoef()Martin Spacek2015-02-251-2/+2
|/ /
* | MAINT: Fix pmt test in numpy/lib/tests/test_financial.py.Charles Harris2015-02-171-24/+22
| | | | | | | | | | | | | | The tests were using assert_almost_equal and setting the precision to 3 decimals. The reason for that low precision appears to have been the failure of the tests for a more reasonable precision. The fix was to use assert_allclose instead.
* | MAINT: Simplify fix for rate == 0 in financial.pmt.Charles Harris2015-02-171-8/+5
| |