summaryrefslogtreecommitdiff
path: root/numpy/lib/twodim_base.py
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* MAINT: lib: Clean up in twodim_base.py.Warren Weckesser2020-01-011-2/+2
| | | | * Remove unused imports.
* DOC: fix documentation of i and j for tri.hvy2019-07-241-1/+1
|
* BUG: further fixup to histogram2d dispatcher.Marten van Kerkwijk2019-06-201-1/+1
| | | | Now with tests....
* MAINT: check bins length in histogram2d_dispatcherStephan Hoyer2019-06-111-4/+11
|
* MAINT: fix histogram*d dispatchersStephan Hoyer2019-06-111-1/+7
| | | | fixes GH-13728
* DOC, TST: clean up matplotlib importsTyler Reddy2019-01-021-4/+2
| | | | | | * as requested by review in gh-12634, the vast majority of docstring matplotlib imports can be simplified to a single line
* DOC, TST: remove agg setting from docsTyler Reddy2019-01-021-1/+0
| | | | | | | * there is no longer any usage of "agg" backend switching in our docstrings because this backend is already activated in the refguide_check machinery
* TST, DOC: enable refguide_checkTyler Reddy2018-12-141-21/+26
| | | | | | | | * 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 :).
* MAINT: set preferred __module__ for numpy functionsStephan Hoyer2018-10-231-1/+7
|
* ENH: __array_function__ support for np.lib, part 2/2 (#12119)Stephan Hoyer2018-10-221-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ENH: __array_function__ support for np.lib, part 2 xref GH12028 np.lib.npyio through np.lib.ufunclike * Fix failures in numpy/core/tests/test_overrides.py * CLN: handle depreaction in dispatchers for np.lib.ufunclike * CLN: fewer dispatchers in lib.twodim_base * CLN: fewer dispatchers in lib.shape_base * CLN: more dispatcher consolidation * BUG: fix test failure * Use all method instead of function in assert_equal * DOC: indicate n is array_like in scimath.logn * MAINT: updates per review * MAINT: more conservative changes in assert_array_equal * MAINT: add back in comment * MAINT: casting tweaks in assert_array_equal * MAINT: fixes and tests for assert_array_equal on subclasses
* MAINT: Rename histogramdd's normed argument to density, to match histogramEric Wieser2018-07-081-4/+10
| | | | Fixes gh-4371
* ENH: Disable fuzzing on histogram boundariesEric Wieser2018-04-301-1/+1
| | | | | | | | | | Previously a fuzzy rounded comparison was used for the rightmost bin of histogramdd. It's not clear why this was done, and it resulted in surprising behavior. This also removes the restriction that bin edges must be floats, and allows integer arrays to be passed (and returned) Fixes gh-10864
* ENH: Add `order=` keyword to `np.eye()` (#9996)Danny Hermes2017-11-121-2/+7
| | | Fixes #9995
* MAINT: Don't internally use the one-argument whereEric Wieser2017-06-031-3/+4
| | | | nonzero is a clearer spelling
* DOC: Correct shape of edges in np.histogram2d (#8980)Importance of Being Ernest2017-04-231-2/+2
| | | | | If nx and ny are the bin counts (as stated in the bins argument's text), then the return H has indeed shape (nx, ny). However, the returned xedges and yedges will then have shape (nx+1,) and (ny+1,) respectively. Fixes #8979
* DOC: Improve histogram2d() example.wrwrwr2016-10-081-29/+17
| | | | Closes #8115.
* ENH: generalize rot90 with axes kwarg, move to function_base.py, and add testsDenis Alevi2016-03-201-57/+4
|
* ENH: Add generalized flip function and its testsEren Sezener2016-03-121-4/+4
|
* DOC: fix a number of reST formatting issues in docstrings.Ralf Gommers2016-02-131-2/+2
|
* DOC: Use print only as function when print_function is imported from __future__gfyoung2015-12-191-1/+1
| | | | Closes gh-6863.
* DOC: Updated docstring for histogram2d as suggested in issue #5538Åsmund Hjulstad2015-02-131-3/+5
| | | | Also, added unittest for [int, array] combination arguments
* BUG: Make diag, diagonal return 1-D arrays for matrix arguments.Charles Harris2015-01-041-2/+2
| | | | | | | | This is an ugly hack to preserve backwards compatibility for code that uses matrices. It is needed since both diag and diagonal have been changed to preserve subtypes otherwise. Note that a.diagonal() still returns matrices when a is a matrix.
* Improved PEP-8 complianceGarrett-R2014-12-081-0/+2
|
* BUG: Closes #2015: diag returns ndarrayGarrett-R2014-12-081-1/+1
| | | | | | | If x is a matrix, np.diag(x) and np.diagonal(x) now return matrices instead of arrays. Both of these cause x.diagonal() to be called. That means they return row vectors (just like x.flatten(), x.ravel(), x.cumprod(), etc.)
* Merge pull request #4929 from juliantaylor/charris-pep8-numpy-libCharles Harris2014-07-311-8/+8
|\ | | | | Charris pep8 numpy lib
| * MAINT: Fixes for problems in numpy/lib revealed by pyflakes.Charles Harris2014-07-311-8/+8
| | | | | | | | | | | | Some of those problems look like potential coding errors. In those cases a Fixme comment was made and the offending code, usually an unused variable, was commented out.
* | BUG: Avoid type promotion in tril and triu.Yotam Doron2014-07-291-2/+2
| |
* | BUG: Use `np.where` in np.triu/np.tril, fixes #4859jaimefrio2014-07-101-3/+6
|/ | | | | Replaces the current method to zero items, from multiplication to using `np.where`.
* STY: Use `.astype`'s `copy` kwarg in `np.tri`jaimefrio2014-05-271-4/+2
| | | | Replace an explicit type check with setting `copy=False` in call to `astype`.
* ENH: Replace exponentiation with cumulative product in np.vanderjaimefrio2014-03-311-25/+27
| | | | | Speeds calculation up by ~3x for 100x100 matrices, and by ~45x for 1000x1000
* 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
| |