summaryrefslogtreecommitdiff
path: root/numpy/lib/twodim_base.py
Commit message (Collapse)AuthorAgeFilesLines
...
* ENH: use smallest integer for tri rangesJulian Taylor2014-03-271-2/+17
| | | | reduces buffer copy and comparison overhead for boolean outer product
* ENH: speed-up of triangular matrix functionsjaimefrio2014-03-251-21/+41
| | | | | | | | | | | | | | | * `np.tri` now produces less intermediate arrays. Runs about 40% faster for general dtypes, up to 3x faster for boolean arrays. * `np.tril` now does smarter type conversions (thanks Julian!), and together with the improvements in `np.tri` now runs about 30% faster. `np.triu` runs almost 2x faster than before, but still runs 20% slower than `np.tril`, which is an improvement over the 50% difference before. * `np.triu_indices` and `np.tril_indices` do not call `np.mask_indices`, instead they call `np.where` directly on a boolean array created with `np.tri`. They now run roughly 2x faster. * Removed the constraint for the array to be square in calls to `np.triu_indices`, `np.tril_indices`, `np.triu_indices_from` and `np.tril_indices_from`.
* DOC: Fix documentation of normed in histogram2d and histogramdd.Charles Harris2014-02-261-21/+18
| | | | | | | | | | The documentation misrepresented what happened, leaving out division by the total number of sample points. Also run spellcheck over function_base.py and twodim_base.py and break some long lines. Closes #2423.
* ENH: tril and triu broadcastingalex2014-02-241-2/+2
|
* Merge pull request #4316 from charris/fix-gh-4092seberg2014-02-181-3/+3
|\ | | | | DOC: Remove \n from strings in plot examples.
| * DOC: Remove \n from strings in plot examples.Charles Harris2014-02-171-3/+3
| | | | | | | | | | | | | | | | The \n occur in plot titles and mess up the generated html. An alternative fix would be to use a raw docstring or \\n, but here it looks simpler to just delete the problem. Closes #4092.
* | DOC: Document that fliplr only works on 2-D arrays.Charles Harris2014-02-161-3/+2
|/ | | | | | Docstring claimed 2-D was not required, but it is. Fix that. Closes #3332.
* Fix typo.Markus Roth2013-11-151-1/+1
|
* DOC: Spelling correction for numpy.diag see alsoChris Kerr2013-11-111-1/+1
|
* MAINT: lib: Use a consistent PEP8-compliant import style in twodim_base.py ↵Warren Weckesser2013-11-021-2/+4
| | | | 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-021-14/+34
| | | | order of the powers (either decreasing or increasing).
* STY: Giant comma spacing fixup.Charles Harris2013-08-181-17/+17
| | | | | | | 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.
* DOC: fix some minor issues with histogram2d docstring formatting.Ralf Gommers2013-08-111-9/+19
|
* DOC: update example of histogram2d to doctest format.Frank Breitling2013-08-111-31/+30
|
* Merge pull request #3531 from fkbreitl/masternjsmith2013-07-181-15/+45
|\ | | | | Updated documentation for histogram2d() in twodim_base.py according to discussion
| * Update twodim_base.pyFrank Breitling2013-07-171-1/+1
| |
| * Update twodim_base.pyFrank Breitling2013-07-131-33/+44
| |
| * Fixed two typos.Frank B2013-02-051-2/+2
| |
| * Added example for 2D-histogram with variable bin size.Frank B2013-02-051-2/+21
| |
* | 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.
* | 2to3: Use absolute imports.Charles Harris2013-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-011-0/+1
|/ | | | | | | | 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.
* DOC: Further tweaks to histogram2d docstring.Stefan van der Walt2012-11-261-9/+11
|
* Remove maskna API from ndarray, and all (and only) the code supporting itNathaniel J. Smith2012-06-161-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original masked-NA-NEP branch contained a large number of changes in addition to the core NA support. For example: - ufunc.__call__ support for where= argument - nditer support for arbitrary masks (in support of where=) - ufunc.reduce support for simultaneous reduction over multiple axes - a new "array assignment API" - ndarray.diagonal() returning a view in all cases - bug-fixes in __array_priority__ handling - datetime test changes etc. There's no consensus yet on what should be done with the maskna-related part of this branch, but the rest is generally useful and uncontroversial, so the goal of this branch is to identify exactly which code changes are involved in maskna support. The basic strategy used to create this patch was: - Remove the new masking-related fields from ndarray, so no arrays are masked - Go through and remove all the code that this makes dead/inaccessible/irrelevant, in a largely mechanical fashion. So for example, if I saw 'if (PyArray_HASMASK(a)) { ... }' then that whole block was obviously just dead code if no arrays have masks, and I removed it. Likewise for function arguments like skipna that are useless if there aren't any NAs to skip. This changed the signature of a number of functions that were newly exposed in the numpy public API. I've removed all such functions from the public API, since releasing them with the NA-less signature in 1.7 would create pointless compatibility hassles later if and when we add back the NA-related functionality. Most such functions are removed by this commit; the exception is PyArray_ReduceWrapper, which requires more extensive surgery, and will be handled in followup commits. I also removed the new ndarray.setasflat method. Reason: a comment noted that the only reason this was added was to allow easier testing of one branch of PyArray_CopyAsFlat. That branch is now the main branch, so that isn't an issue. Nonetheless this function is arguably useful, so perhaps it should have remained, but I judged that since numpy's API is already hairier than we would like, it's not a good idea to add extra hair "just in case". (Also AFAICT the test for this method in test_maskna was actually incorrect, as noted here: https://github.com/njsmith/numpyNEP/blob/master/numpyNEP.py so I'm not confident that it ever worked in master, though I haven't had a chance to follow-up on this.) I also removed numpy.count_reduce_items, since without skipna it became trivial. I believe that these are the only exceptions to the "remove dead code" strategy.
* Document the PyArray_Diagonal transition scheme.Nathaniel J. Smith2012-05-161-2/+5
|
* Transition scheme for allowing PyArray_Diagonal to return a viewNathaniel J. Smith2012-05-161-1/+7
| | | | | | | | | | | | | | | | PyArray_Diagonal is changed to return a copy of the diagonal (as in numpy 1.6 and earlier), but with a new (hidden) WARN_ON_WRITE flag set. Writes to this array (or views thereof) will continue to work as normal, but the first write will trigger a DeprecationWarning. We also issue this warning if someone extracts a non-numpy writeable view of the array (e.g., by accessing the Python-level .data attribute). There are likely still places where the data buffer is exposed that I've missed -- review welcome! New known-fail test: eye() for maskna arrays was only implemented by exploiting ndarray.diagonal's view-ness, so it is now unimplemented again, and the corresponding test is marked known-fail.
* DOC: merge wiki doc edits.Ralf Gommers2012-03-031-9/+14
|
* FIX: Make tril/triu return the same dtype as the original array.Fabian Pedregosa2011-08-311-2/+2
| | | | | | | This should fix: * http://projects.scipy.org/numpy/ticket/1848 * http://projects.scipy.org/scipy/ticket/1449
* ENH: missingdata: Add maskna= flag to np.eye constructorMark Wiebe2011-08-271-10/+6
|
* ENH: missingdata: Add NA support to np.diagonal, change np.diagonal to ↵Mark Wiebe2011-08-271-11/+4
| | | | always return a view
* WHT: Cleanup trailing whitespace.Charles Harris2011-04-021-1/+0
|
* BUG: Fix ticket #1579. Do some cleanups.Charles Harris2010-08-101-40/+51
|
* DOC: wiki merge, twodim_base and a few loose ones.rgommers2010-07-311-31/+33
|
* DOC - fix doc errorMatthew Brett2010-03-111-1/+1
|
* fixed a whole bunch of doctestsPaul Ivanov2009-12-281-2/+2
|
* Docstring update: libPauli Virtanen2009-10-021-72/+126
|
* Docstring updates, part 1Pauli Virtanen2009-10-021-49/+74
|
* Address #1167: faster twodim_base.diag/eye implementation by Luca Citi + testsPauli Virtanen2009-07-121-21/+26
|
* Fix versioning and inclusion to ref. guide in docs for #1132Pauli Virtanen2009-07-041-0/+20
|
* Add indexing functions by Fernando Perez.Stefan van der Walt2009-07-041-2/+214
|
* Merge from the doc wikiPauli Virtanen2009-03-241-9/+36
|
* Import documentation from doc wiki (part 2, work-in-progress docstrings, but ↵Pauli Virtanen2008-10-281-15/+15
| | | | they are still an improvement)
* Import documentation from doc wiki (part 1)Pauli Virtanen2008-10-271-2/+2
|
* Removed unused imports.Alan McIntyre2008-09-181-1/+1
|
* Merge from documentation editor.Stefan van der Walt2008-08-051-56/+391
|
* Use the implicit "import numpy as np" made available to all doctests instead Alan McIntyre2008-07-051-4/+4
| | | | | of explicit imports or dependency on the local scope where the doctest is defined..
* ran reindent in preparation for the 1.1 releaseJarrod Millman2008-04-201-6/+6
|
* Fix vander docstring.Stefan van der Walt2008-04-091-4/+3
|