summaryrefslogtreecommitdiff
path: root/numpy/lib/index_tricks.py
Commit message (Collapse)AuthorAgeFilesLines
* DEP: Deprecated ndindex.ndincrEric Wieser2020-09-031-0/+9
| | | | The "do not use" comment has been here since bb0e4f356cce2f199d9c08ffe572fbabadc846d1.
* DOC: update val to be scalar or array like optional closes #16901 (#16907)Paul2020-07-311-3/+5
| | | | | * DOC: update val to be scalar or array like optional closes #16901 Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Merge pull request #16815 from cjblocker/mgrid-floatMatti Picus2020-07-251-7/+7
|\ | | | | BUG: fix mgrid output for lower precision float inputs
| * BUG: fix mgrid output for lower precision float inputsCameron Blocker2020-07-121-7/+7
| | | | | | | | | | | | Floats besides float64 were being coerced to integers and complex step sizes for the index trick classes would fail for complex64 input. Fixes #16466
* | DOC: fix inconsistent parameter name in np.ndindex docstringRohit Sanjay2020-07-131-1/+1
|/
* DOC: adding docs on passing dimensions as tuple to ndindex (#16806)Neal C2020-07-111-2/+14
| | | | | | * adding documentation on passing dimensions to ndindex as a tuple Co-authored-by: sun <sun@vosdbt.org>
* DOC: Minor RST formatting. (#16792)Matthias Bussonnier2020-07-091-2/+2
| | | DOC: fixes to capitalization and header lines
* Update numpy/lib/index_tricks.pyKerem Hallaç2020-04-251-1/+3
| | | Co-Authored-By: Ross Barnowski <rossbar@berkeley.edu>
* ENH: Fix exception causes in four .py fileskeremh2020-04-241-2/+2
|
* MAINT: Clean-up 'next = __next__' used for Python 2 compatibilityMike Taves2020-04-011-4/+0
|
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-5/+5
| | | | | | | Inheriting from object was necessary for Python 2 compatibility to use new-style classes. In Python 3, this is unnecessary as there are no old-style classes. Dropping the object is more idiomatic Python.
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-031-2/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* Merge pull request #8641 from eric-wieser/ix_-preserve-typeMatti Picus2019-04-291-4/+5
|\ | | | | BUG: Preserve types of empty arrays in ix_ when known
| * Merge branch 'master' into ix_-preserve-typeEric Wieser2018-07-311-94/+155
| |\
| * | BUG: Preserve types of empty arrays when knownEric Wieser2017-02-191-4/+5
| | | | | | | | | | | | Fixes regression in #5805
* | | DOC: Added anti-diagonal examples to np.diagonal and np.fill_diagonalAnder Ustarroz2019-04-131-3/+20
| | |
* | | avoid using math.Matthias Bussonnier2019-02-131-1/+1
| | |
* | | Properly format Return section of ogrid Docstring,Matthias Bussonnier2019-02-131-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Without the newline and indent, the markup is not interpreted. Note that in the see-also `np.lib.index_tricks.nd_grid` is reference but not linked as it appear to not be autogenerated, but this is another issue.
* | | TST, DOC: enable refguide_checkTyler Reddy2018-12-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | * ported the refguide_check module from SciPy for usage in NumPy docstring execution/ verification; added the refguide_check run to Azure Mac OS CI * adjusted NumPy docstrings such that refguide_check passes
* | | ENH: set correct __module__ for objects in numpy's public APIStephan Hoyer2018-11-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes GH-12271 Tests verify that everything in ``dir(numpy)`` either has ``__module__`` set to ``'numpy'``, or appears in an explicit whitelist of undocumented functions and exported bulitins. These should eventually be documented or removed. I also identified a handful of functions for which I had accidentally not setup dispatch for with ``__array_function__`` before, because they were listed under "ndarray methods" in ``_add_newdocs.py``. I guess that should be a lesson in trusting code comments :).
* | | BUG: Revert linspace import for concatenation funcs (#12265)James Bourbeau2018-10-261-3/+2
| | | | | | | | | BUG: test and fix import linspace in index_tricks
* | | MAINT: set preferred __module__ for numpy functionsStephan Hoyer2018-10-231-1/+6
| | |
* | | MAINT: remove unused nd_grid __len__Tyler Reddy2018-10-161-3/+0
| | |
* | | ENH: __array_function__ for np.lib, part 1Stephan Hoyer2018-10-081-0/+17
| |/ |/| | | | | np.lib.arraypad through np.lib.nanfunctions
* | MAINT: Remove python-side docstrings from add_newdocs.Eric Wieser2018-07-011-31/+92
| | | | | | | | | | | | From the header comment in add_newdocs, it is only intended for C modules. This also fixes `help(np.mgrid)`, which previously only showed the help for `nd_grid`
* | BUG: Avoid deprecated non-tuple indexingEric Wieser2018-05-281-1/+1
| | | | | | | | np.ogrid was not tested anyway, so this was not caught.
* | BUG: Fix mutating state between items in np,r_Eric Wieser2017-12-111-3/+3
| | | | | | | | It's not at all clear what trans1d is supposed to do here, but it's certainly not supposed to change value between elements!
* | ENH: Allow np.r_ to accept 0d arraysEric Wieser2017-12-111-16/+11
| | | | | | | | Fixes gh-9233
* | MAINT/DOC: Use builtin when np.{x} is builtins.{x}.Eric Wieser2017-08-051-1/+1
| | | | | | | | | | | | | | This is the case for x in {int, bool, str, float, complex, object}. Using the np.{x} version is deceptive as it suggests that there is a difference. This change doesn't affect any external behaviour. The `long` type is missing in python 3, so np.long is still useful
* | BUG: KeyboardInterrupt is swallowed all over the placeEric Wieser2017-06-031-1/+1
| | | | | | | | Bare except is very rarely the right thing
* | ENH: Spelling fixesVille Skyttä2017-05-091-1/+1
| |
* | BUG: np.ma.mr_['r',...] does not return masked arraysEric Wieser2017-05-051-3/+3
| |
* | BUG: np.r_['r',...] crashes on scalarsEric Wieser2017-05-051-1/+1
| |
* | BUG: np.r_['rc'] is treated as np.r_['r'], not an errorEric Wieser2017-05-051-1/+1
| |
* | MAINT: Use enumerate instead of range(len(...))Eric Wieser2017-05-051-15/+14
| |
* | BUG: Remove mutable state from AxisConcatenatorEric Wieser2017-05-051-29/+26
| | | | | | | | Fixes #8815
* | MAINT: Remove code duplicated from np.r_ in np.ma.mr_Eric Wieser2017-05-051-1/+3
| | | | | | | | | | Also adds a test for the disabled-by-design behaviour - this would return raw matrices, not masked arrays
* | DOC: Added “See Also” section for c_Philipp A2017-02-221-2/+5
| |
* | DOC: Added more common example for np.c_Philipp A2017-02-221-0/+4
|/ | | | I mostly use that object to bind 1D arrays as columns, so I added an example for that use case.
* Merge pull request #8633 from MSeifert04/boolean_arrays_in_ix__funcEric Wieser2017-02-191-1/+14
|\ | | | | DOC: Mention boolean arrays in the ix_ documentation.
| * DOC: Mention boolean arrays in the ix_ documentation.Michael Seifert2017-02-181-1/+14
| |
* | DOC: Fix typo in fill_diagonal docstring.Antony Lee2017-02-181-2/+2
|/
* MAINT: Remove __setslice__ and __getslice__Eric Wieser2017-02-091-7/+0
| | | | | This code was only here for Python 2.5 compatibility, but numpy requires 2.7 at minimum
* DOC: Use print only as function when print_function is imported from __future__gfyoung2015-12-191-2/+2
| | | | Closes gh-6863.
* DOC: typo: affectLars Buitinck2015-10-021-1/+1
|
* BUG: made view of new array to fix ix_ bugmlai2015-07-111-1/+1
| | | | | | closes gh-6062 done with help of Sebastian Berg! =)
* DOC, MAINT: fix typo in np.fill_diagonal docstring exampleFrançois Magimel2015-06-241-3/+5
|
* Merge pull request #5605 from shoyer/stackCharles Harris2015-05-121-1/+1
|\ | | | | ENH: add np.stack
| * ENH: add np.stackStephan Hoyer2015-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | BUG: Fix handling of non-empty ndarraysJaime Fernandez2015-05-041-3/+5
| |