diff options
author | Ross Barnowski <rossbar@berkeley.edu> | 2020-03-11 10:53:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-11 10:53:27 -0700 |
commit | b074b21c326ecaa6b6519fc7dfcf54fa4e4457af (patch) | |
tree | 37c463c354ec01c54f01bd6070ba96166ebb3211 /doc | |
parent | 59a97520cf0aa68b92a775d809e1cb67d886b50c (diff) | |
download | numpy-b074b21c326ecaa6b6519fc7dfcf54fa4e4457af.tar.gz |
ENH: Add `subok` parameter to np.copy function (cf. gfh6509) (gh-15685)
This is largely a re-submission of the original change proposed in #6509. Discussion was hosted in multiple forums including #3474, the numpy mailing list circa 10-2015, and the 02-26-2020 NumPy Triage meeting.
This PR closes #3474 and #15570
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/upcoming_changes/15685.new_feature.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/release/upcoming_changes/15685.new_feature.rst b/doc/release/upcoming_changes/15685.new_feature.rst new file mode 100644 index 000000000..c4ed04e93 --- /dev/null +++ b/doc/release/upcoming_changes/15685.new_feature.rst @@ -0,0 +1,9 @@ +``subok`` option for `numpy.copy` +--------------------------------- +A new kwarg, ``subok``, was added to `numpy.copy` to allow users to toggle the +behavior of `numpy.copy` with respect to array subclasses. The default value +is ``False`` which is consistent with the behavior of `numpy.copy` for +previous numpy versions. To create a copy that preserves an array subclass with +`numpy.copy`, call ``np.copy(arr, subok=True)``. This addition better documents +that the default behavior of `numpy.copy` differs from the +`numpy.ndarray.copy` method which respects array subclasses by default. |