summaryrefslogtreecommitdiff
path: root/numpy/lib/index_tricks.py
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: adept divisions for truedivideSebastian Berg2013-05-311-1/+1
| | | | Following deprecations would cause problems otherwise.
* MAINT: Apply 2to3 idioms fixer.Charles Harris2013-05-021-3/+3
| | | | | | | | | | | | | | | | | | | The idioms fixer makes the following replacements. 1) int <- bool 2) comparison or identity of types <- isinstance 3) a.sort() <- sorted(a) There were two problems that needed to be dealt with after the application of the fixer. First, the replacement of comparison or identity of types by isinstance was not always correct. The isinstance function returns true for subtypes whereas many of the places where the fixer made a substitution needed to check for exact type equality. Second, the sorted function was applied to arrays, but because it treats them as iterators and constructs a sorted list from the result, that is the wrong thing to do. Closes #3062.
* 2to3: Apply next fixer.Charles Harris2013-04-151-7/+12
| | | | | | | | | | | | | | The next builtin has been available since Python 2.6 and allows `it.next()` to be replaced by `next(it)`. In Python 3 the `next` method is gone entirely, replaced entirely by the `__next__` method. The next fixer changes all the `it.next()` calls to the new form and renames the `next` methods to `__next__`. In order to keep Numpy code backwards compatible with Python 2, a `next` method was readded to all the Numpy iterators after the fixer was run so they all contain both methods. The presence of the appropriate method could have been made version dependent, but that looked unduly complicated. Closes #3072.
* 2to3: Apply `map` fixer.Charles Harris2013-04-101-2/+2
| | | | | | | | | | | | | | | | | | | In Python 3 `map` is an iterator while in Python 2 it returns a list. The simple fix applied by the fixer is to inclose all instances of map with `list(...)`. This is not needed in all cases, and even where appropriate list comprehensions may be preferred for their clarity. Consequently, this patch attempts to use list comprehensions where it makes sense. When the mapped function has two arguments there is another problem that can arise. In Python 3 map stops execution when the shortest argument list is exhausted, while in Python 2 it stops when the longest argument list is exhausted. Consequently the two argument case might need special care. However, we have been running Python3 converted versions of numpy since 1.5 without problems, so it is probably not something that affects us. Closes #3068
* 2to3: Apply `print` fixer.Charles Harris2013-04-061-1/+1
| | | | | | | Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
* Merge pull request #460 from endolith/regex_formattingCharles Harris2013-04-031-1/+2
|\ | | | | DOC: Formatting fixes using regex
| * DOC: Used regex to find colons missing spaces which render wrong online, ↵endolith2013-03-191-1/+2
| | | | | | | | also other spacing or formatting mistakes
* | Merge pull request #3178 from charris/2to3-apply-import-fixernjsmith2013-04-021-3/+3
|\ \ | | | | | | 2to3 apply import fixer
| * | 2to3: Use absolute imports.Charles Harris2013-03-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new import `absolute_import` is added the `from __future__ import` statement and The 2to3 `import` fixer is run to make the imports compatible. There are several things that need to be dealt with to make this work. 1) Files meant to be run as scripts run in a different environment than files imported as part of a package, and so changes to those files need to be skipped. The affected script files are: * all setup.py files * numpy/core/code_generators/generate_umath.py * numpy/core/code_generators/generate_numpy_api.py * numpy/core/code_generators/generate_ufunc_api.py 2) Some imported modules are not available as they are created during the build process and consequently 2to3 is unable to handle them correctly. Files that import those modules need a bit of extra work. The affected files are: * core/__init__.py, * core/numeric.py, * core/_internal.py, * core/arrayprint.py, * core/fromnumeric.py, * numpy/__init__.py, * lib/npyio.py, * lib/function_base.py, * fft/fftpack.py, * random/__init__.py Closes #3172
* | | Merge pull request #3104 from seberg/nditer-allow-0dCharles Harris2013-04-011-24/+1
|\ \ \ | |/ / |/| | Make AdvancedNew iter more 0-d aware
| * | MAINT: Remove np.ndindex 0-d hack.Sebastian Berg2013-03-031-24/+1
| |/
* | 2to3: Replace xrange by range and use list(range(...)) where neededCharles Harris2013-03-271-1/+1
|/ | | | | | | | | | | | | | | In python3 range is an iterator and `xrange` has been removed. This has two consequence for code: 1) Where a list is needed `list(range(...))` must be used. 2) `xrange` must be replaced by `range` Both of these changes also work in python2 and this patch makes both. There are three places fixed that do not need it, but I left them in so that the result would be `xrange` clean. Closes #3092
* 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-011-0/+2
| | | | | | | | This should be harmless, as we already are division clean. However, placement of this import takes some care. In the future a script can be used to append new features without worry, at least until such time as it exceeds a single line. Having that ability will make it easier to deal with absolute imports and printing updates.
* Fix-up logic for checking for zero-d arrays.Travis E. Oliphant2013-01-211-1/+3
|
* Fix 0-d ndincr to have correct return value.Travis E. Oliphant2013-01-111-1/+1
|
* Fix the test for numpy.ndindex()Travis E. Oliphant2013-01-111-5/+18
| | | | | Fix ndindex for 0-d arrays. Add tests for tuple arguments to ndindex
* Use super instead of direct access to inheritance.Travis E. Oliphant2013-01-101-1/+1
|
* Fix the 0-d patch so it doesn't change the non 0-d iteratorTravis E. Oliphant2013-01-101-11/+11
|
* Fix ndindex for 0-d arrays.Travis E. Oliphant2013-01-101-1/+10
|
* Retain backward compatibility. Enforce C order.Stefan van der Walt2012-09-021-1/+9
|
* Improve ndindex execution speed.Stefan van der Walt2012-09-021-41/+8
|
* add the warp parameter to fill_diagonal for people that could want the old ↵Frederic2012-06-111-4/+33
| | | | behavior.
* fix the wrapping problem of fill_diagonal with tall matrix.Frederic2012-06-111-1/+4
|
* STY: Fix up some two line old-style exceptions.Charles Harris2011-04-051-2/+2
|
* STY: Update exception style, easy ones.Charles Harris2011-04-051-3/+3
|
* API: Rename 'coords' to 'multi-index' in ravel_coords and iterator APIMark Wiebe2011-03-141-2/+2
|
* BUG: Fix python3k import problem.Charles Harris2011-02-111-1/+1
|
* ENH: index_tricks: Implement unravel_index and ravel_coords functions in CMark Wiebe2011-02-101-63/+3
|
* BUG: lib: clean up ancient-Python era stuff from IndexExpression (#1196)Pauli Virtanen2010-10-111-10/+1
|
* 3K: BUG: fix unravel_index integer divisionPauli Virtanen2010-02-211-1/+1
|
* fixed a whole bunch of doctestsPaul Ivanov2009-12-281-4/+5
|
* Docstring update: libPauli Virtanen2009-10-021-55/+121
|
* Rename matrx to matrixlib.David Cournapeau2009-09-181-1/+1
| | | | | I forgot to commit the name change suggested by Stefan. You need to clean build/install directory when updating to this version.
* Move matrix class into its own module.David Cournapeau2009-09-161-1/+1
|
* Improvement to fill_diagonal suggested by Anand Patil.Stefan van der Walt2009-07-081-1/+1
|
* Fix versioning and inclusion to ref. guide in docs for #1132Pauli Virtanen2009-07-041-8/+21
|
* Fix diag_indices_from and add test.Stefan van der Walt2009-07-041-10/+11
|
* Add indexing functions by Fernando Perez.Stefan van der Walt2009-07-041-2/+155
|
* Merge from doc wikiPauli Virtanen2009-06-191-27/+191
|
* Merge from the doc wikiPauli Virtanen2009-03-241-6/+14
|
* More add_newdocs entries, and make add_newdoc capable of adding docs also to ↵Pauli Virtanen2009-02-141-0/+2
| | | | normal Python objects.
* Import documentation from doc wiki (part 2, work-in-progress docstrings, but ↵Pauli Virtanen2008-10-281-10/+9
| | | | they are still an improvement)
* Removed unused imports.Alan McIntyre2008-09-181-1/+1
|
* Merge from documentation editor.Stefan van der Walt2008-08-051-11/+42
|
* Fix doctests to run properly under new execution context.Alan McIntyre2008-07-131-4/+4
|
* Make doctests pass under new execution context.Alan McIntyre2008-07-091-6/+6
|
* Merge documentation changes from wiki.Stefan van der Walt2008-05-191-41/+41
|
* ran reindent in preparation for the 1.1 releaseJarrod Millman2008-04-201-1/+1
|
* Fixed #728 scalar coercion problem with mixed types and r_Travis Oliphant2008-04-111-9/+13
|
* Convert some internal classes in index_tricks.py to CamelCasecookedm2007-12-261-16/+18
|