summaryrefslogtreecommitdiff
path: root/numpy/add_newdocs.py
Commit message (Collapse)AuthorAgeFilesLines
* ENH: implement may_share_memory in CJulian Taylor2013-05-281-0/+26
| | | | | | | | | memmap needs to call it in __array_finalize__ to determine if it can drop the references on copies. The python version if may_share_memory caused significant slowdowns when slicing these maps. closes gh-3364
* DOC: Add NPY_RELAXED_STRIDES_DOCUMENTATION doc to ndarry.flagsSebastian Berg2013-04-111-2/+11
|
* 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-11/+7
|\ | | | | DOC: Formatting fixes using regex
| * DOC: Used regex to find colons missing spaces which render wrong online, ↵endolith2013-03-191-11/+7
| | | | | | | | also other spacing or formatting mistakes
* | 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: Replace xrange by range and use list(range(...)) where neededCharles Harris2013-03-271-4/+4
|/ | | | | | | | | | | | | | | 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-6/+10
| | | | | | | | 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: Add example showing how a view of a slice can misbehaveSteve2013-02-051-0/+16
|
* DOC -- add another paragraph note to ndarray.view docs (cont'd)Steve2013-02-051-5/+8
| | | | | More detail: Views are only sensitive to under-the-hood storage when the dtype storage size has changed.
* DOC -- add another paragraph note to ndarray.view docsSteve2013-02-041-0/+6
| | | | | | | Since most numpy operations are not sensitive to underlying data structure (C-ordered arrays vs fortran-ordered arrays, versus slices or transposes of arrays, etc.), but structured-array views ARE sensitive to that, it is worth saying it explicitly in the documentation.
* Improvements to ndarray.view docstringThomas Robitaille2012-11-221-4/+6
|
* [FIX] preserve memory order in np.copy()Nathaniel J. Smith2012-10-011-1/+4
| | | | | This switches us back to the behaviour seen in numpy 1.6 and earlier, which it turns out that scikit-learn (and probably others) relied on.
* Add doc to {empty,zeros,ones}_like that tell in witch version their dtype ↵Frederic2012-09-261-0/+2
| | | | and order parameter was added
* DOC: describe output from astype methodMatthew Brett2012-09-131-0/+8
| | | | Expand docstring for ``astype`` method.
* DOC: merge wiki edits. Add percentile to statistics routines (ML suggestion).Ralf Gommers2012-07-071-5/+17
|
* Remove PyArray_ReduceWrapper from public APINathaniel J. Smith2012-06-161-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two reasons to want to keep PyArray_ReduceWrapper out of the public multiarray API: - Its signature is likely to change if/when masked arrays are added - It is essentially a wrapper for array->scalar transformations (*not* just reductions as its name implies -- the whole reason it is in multiarray.so in the first place is to support count_nonzero, which is not actually a reduction!). It provides some nice conveniences (like making it easy to apply such functions to multiple axes simultaneously), but, we already have a general mechanism for writing array->scalar transformations -- generalized ufuncs. We do not want to have two independent, redundant implementations of this functionality, one in multiarray and one in umath! So in the long run we should add these nice features to the generalized ufunc machinery. And in the short run, we shouldn't add it to the public API and commit ourselves to supporting it. However, simply removing it from numpy_api.py is not easy, because this code was used in both multiarray and umath. This commit: - Moves ReduceWrapper and supporting code to umath/, and makes appropriate changes (e.g. renaming it to PyUFunc_ReduceWrapper and cleaning up the header files). - Reverts numpy.count_nonzero to its previous implementation, so that it loses the new axis= and keepdims= arguments. This is unfortunate, but this change isn't so urgent that it's worth tying our APIs in knots forever. (Perhaps in the future it can become a generalized ufunc.)
* Remove maskna API from ndarray, and all (and only) the code supporting itNathaniel J. Smith2012-06-161-129/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #245 from jseabold/digitize-open-rightTravis E. Oliphant2012-04-041-2/+17
|\ | | | | ENH: Give digitize left or right open interval option
| * DOC: Clarify digitize docs and add exampleSkipper Seabold2012-04-031-5/+11
| |
| * ENH: Give digitize left or right open interval optionSkipper Seabold2012-04-031-2/+11
| |
* | ENH: Add 'sorter' argument to searchsorted.Bryan Van de Ven2012-04-041-1/+1
|/ | | | | | | | The new argument allows one to search an argsorted array by passing in the result of argsorting the array as the 'sorter' argument. For example searchsorted(a, sorter=a.argsort)
* DOC: label the current NA implementation as experimental in 1.7.xRalf Gommers2012-03-301-0/+11
| | | | This has been extensively discussed on the mailing list. See #2072.
* DOC: merge wiki doc edits.Ralf Gommers2012-03-031-5/+16
|
* DOC: putmask: mention copyto is NA-aware, and recommend to switch to it.Ralf Gommers2011-12-301-2/+4
|
* DEP: undeprecate putmask. Used a lot, no need to deprecate it.Ralf Gommers2011-12-301-4/+4
|
* ENH: Add function for adding docstrings to ufuncs.Chris Jordan-Squire2011-08-291-1/+28
|
* DOC: missingdata: Add introductory documentation for NA-masked arraysMark Wiebe2011-08-271-0/+38
|
* ENH: missingdata: Add maskna= and ownmaskna= parameters to np.asarray and ↵Mark Wiebe2011-08-271-1/+14
| | | | | | | | friends Also fix some array() NA mask construction issues and make sure the base object doesn't collapse past the owner of the NA mask being viewed in addition to the data.
* ENH: missingdata: Add maskna= parameter to np.copy and ndarray.copyMark Wiebe2011-08-271-6/+10
|
* ENH: missingdata: Implement skipna= support for np.std and np.varMark Wiebe2011-08-271-1/+1
|
* ENH: missingdata: Support 'skipna=' parameter in np.meanMark Wiebe2011-08-271-4/+27
| | | | | Also add 'keepdims=' parameter to reductions, to support writing of the np.std function.
* ENH: missingdata: Create count_reduce_items functionMark Wiebe2011-08-271-1/+56
| | | | | | | This function either cheaply returns the product of the sizes of all the reduction axes, or counts the number of items which will be used in a reduction operation when skipna is True. Its purpose is to make it easy to do functions like np.mean and np.std.
* ENH: missingdata: Rewrite PyArray_Concatenate to work with NA masksMark Wiebe2011-08-271-2/+5
| | | | | It should also have less memory usage for heterogeneous inputs, because it no longer makes extra copies in that case.
* ENH: missingdata: Add NA support to np.diagonal, change np.diagonal to ↵Mark Wiebe2011-08-271-1/+1
| | | | always return a view
* DOC: ufunc: Document the 'axis=' improvments to reduction functionsMark Wiebe2011-08-271-2/+16
|
* ENH: missingdata: Progress towards supporting ufunc reduce with NA masksMark Wiebe2011-08-271-1/+3
|
* ENH: missingdata: Fill in buffered NAMASK nditer, add maskna= to zeros, ↵Mark Wiebe2011-08-271-0/+2
| | | | empty, and empty_like
* DOC: nditer: Add links to the nditer introductory doc to make it more ↵Mark Wiebe2011-08-251-0/+2
| | | | discoverable
* DOC: datetime: Update the docs to reflect busday_count changeMark Wiebe2011-07-191-3/+1
|
* DOC: datetime: Update docstrings for busdays code.Steve R. Hastings2011-07-191-83/+92
| | | | | | | | | | The previous checkin has examples for working with datetime64 objects and the busdays functions. Edit the docstrings for busdays to harmonize them with the language used in the examples. Instead of saying "business days", now say "valid days". The default valid days are Monday through Friday, business days, but other sets of valid days are possible.
* STY: Fix 'copy' 'copyto' typo and remove some trailing whitespace.Charles Harris2011-07-091-1/+1
|
* ENH: Use np.copyto instead of np.fill in some placesMark Wiebe2011-07-081-5/+0
| | | | | This should allow one to create struct dtype arrays with np.ones and np.zeros_like.
* ENH: core: Add np.copyto, PyArray_MaskedMoveInto, PyArray_MaskedCopyIntoMark Wiebe2011-07-081-1/+52
| | | | | | | | These functions expose masked copying routines, with and without handling of overlapping data. Also deprecated the np.putmask and PyArray_PutMask functions, because np.copyto supercedes their functionality. This will need to be discussed on the list during the pull request review.
* DOC: minor documentation fixesPauli Virtanen2011-06-251-0/+2
|
* DOC: dtype-struct: Document the changes to struct dtypesMark Wiebe2011-06-221-1/+10
|
* DOC: datetime-feedback: Applying Ralf's feedback for the parameter conventionsMark Wiebe2011-06-151-17/+17
|
* STY: datetime-feedback: Rename np.busdaydef -> np.busdaycalendarMark Wiebe2011-06-151-21/+23
| | | | | Also rename the busdaydef parameters to busdaycal parameters. This change was motivated by Chuck's code review feedback.
* DOC: datetime-feedback: Various comment/documentation tweaks from Chuck's ↵Mark Wiebe2011-06-151-4/+6
| | | | review feedback
* DOC: datetime-bday: Document the datetime business day functionsMark Wiebe2011-06-141-0/+262
|