diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2011-07-09 09:25:53 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-07-09 09:25:53 -0600 |
commit | 98d0c8f79443bf6f44883739d1876a3dc2498f6f (patch) | |
tree | 887948c79959cbc0700e34c2b8e30feffd6a0c72 /numpy/add_newdocs.py | |
parent | 978862660363f17962149ece1dfb67fa8051a8a1 (diff) | |
parent | a26bb0d7ba1f8ac541c9048bcc88bb8031d5d283 (diff) | |
download | numpy-98d0c8f79443bf6f44883739d1876a3dc2498f6f.tar.gz |
Merge branch 'pull-105'
* pull-105:
STY: Put spaces around the '&' and '|' operators.
STY: Fix 'copy' 'copyto' typo and remove some trailing whitespace.
ENH: Use np.copyto instead of np.fill in some places
ENH: core: Add np.copyto, PyArray_MaskedMoveInto, PyArray_MaskedCopyInto
ENH: core: Add support for masked strided transfer functions
NEP: missingdata: Add a small note about single NA vs multi-NA
NEP: missingdata: Describe a possible way multi-NA could be added in the future
NEP: missingdata: Change the mask definition
STY: Some small stylistic changes
ENH: nditer: Add the basic checking and input of the MASK-related flags
NEP: missingdata: Design the mask binary format so it's extensible with a payload
DEP: core: Move 'fortran' macro into the deprecated header
ENH: nditer: Add the per-operand masked iteration flags
WRN: Get rid of some of the deprecation warnings about 'O4'
DEP: core: Move NPY_AO into the deprecated API header
Diffstat (limited to 'numpy/add_newdocs.py')
-rw-r--r-- | numpy/add_newdocs.py | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py index 2f9071378..1e1d237a4 100644 --- a/numpy/add_newdocs.py +++ b/numpy/add_newdocs.py @@ -3184,6 +3184,10 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('copy', order. If order is 'A' ('Any'), then the result has the same order as the input. + See also + -------- + numpy.copyto + Examples -------- >>> x = np.array([[1,2,3],[4,5,6]], order='F') @@ -3690,11 +3694,45 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('put', """)) +add_newdoc('numpy.core.multiarray', 'copyto', + """ + copyto(dst, src, casting='same_kind', where=None) + + Copies values from `src` into `dst`, broadcasting as necessary. + Raises a TypeError if the casting rule is violated, and if + `where` is provided, it selects which elements to copy. + + .. versionadded:: 1.7.0 + + Parameters + ---------- + dst : ndarray + The array into which values are copied. + src : array_like + The array from which values are copied. + casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional + Controls what kind of data casting may occur when copying. + + * 'no' means the data types should not be cast at all. + * 'equiv' means only byte-order changes are allowed. + * 'safe' means only casts which can preserve values are allowed. + * 'same_kind' means only safe casts or casts within a kind, + like float64 to float32, are allowed. + * 'unsafe' means any data conversions may be done. + where : array_like of bool + A boolean array which is broadcasted to match the dimensions + of `dst`, and selects elements to copy from `src` to `dst` + wherever it contains the value True. + + """) add_newdoc('numpy.core.multiarray', 'putmask', """ putmask(a, mask, values) + This function is deprecated as of NumPy 1.7. Use the function + ``np.copyto(a, values, where=mask)`` to achieve this functionality. + Changes elements of an array based on conditional and input values. Sets ``a.flat[n] = values[n]`` for each n where ``mask.flat[n]==True``. @@ -3714,7 +3752,7 @@ add_newdoc('numpy.core.multiarray', 'putmask', See Also -------- - place, put, take + place, put, take, copyto Examples -------- @@ -5959,6 +5997,8 @@ add_newdoc('numpy.core.multiarray', 'busdaycalendar', information defining business days for the business day-related functions. + .. versionadded:: 1.7.0 + Parameters ---------- weekmask : str or array_like of bool, optional @@ -6018,6 +6058,8 @@ add_newdoc('numpy.core.multiarray', 'is_busday', Calculates which of the given dates are valid business days, and which are not. + .. versionadded:: 1.7.0 + Parameters ---------- dates : array_like of datetime64[D] @@ -6070,6 +6112,8 @@ add_newdoc('numpy.core.multiarray', 'busday_offset', the ``roll`` rule, then applies offsets to the given dates counted in business days. + .. versionadded:: 1.7.0 + Parameters ---------- dates : array_like of datetime64[D] @@ -6158,6 +6202,8 @@ add_newdoc('numpy.core.multiarray', 'busday_count', Counts the number of business days between `begindates` and `enddates`, not including the day of `enddates`. + .. versionadded:: 1.7.0 + Parameters ---------- begindates : array_like of datetime64[D] |