-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document deep
parameter in ExtensionArray.copy
#22314
Comments
We should also clarify what exactly a deep vs. shallow copy should mean... My use-case is |
I suppose so.
The docstring of
(with of course the additional caveats regarding python objects not being copied recursively and index data not being copied). For ExtensionArray it is of course not necessarily that straightforward, since there is no fixed "data" for all EAs. But I think typically an EA will have some kind of |
Like in #19862, I would argue that:
|
@h-vetinari I think the other discussion is not fully relevant here, as an ExtensionArray has (in general) no notion of 'index' that is immutable and not copied like a Series/DataFrame has. |
This is also not tested directly in the base extension tests. Testing the semantics will be a tad, since we don't have a no-copy way of getting some kind of |
We could test the expected "user semantics" ?
|
Ah, yeah that will work for mutable EAs (my head is in sparse-land right now, which is not mutable). |
Ah, OK, I now understand why you asked the initial question. In that case (SparseArray being immutable), then it is again more similar to the "copy index of Series or not" discussion. Is there a reason they are immutable? (it's just more work to implement it? Scipy sparse matrices are mutable, but raise a performance warning if the mutation changes the sparsity structure) |
Just more work to implement I think.
…On Mon, Aug 13, 2018 at 11:09 AM Joris Van den Bossche < ***@***.***> wrote:
Ah, OK, I now understand why you asked the initial question. In that case
(SparseArray being immutable), then it is again more similar to the "copy
index of Series or not" discussion.
Is there a reason they are immutable? (it's just more work to implement
it? Scipy sparse matrices are mutable, but raise a performance warning if
the mutation changes the sparsity structure)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#22314 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIvAqtktzLAH_SQ-L0iR9BbNf2TWwks5uQaTUgaJpZM4V6fuW>
.
|
deep
parameter in ExtensionArray.copy
Coming back to my comment above #22314 (comment) about expected user semantics. Another option is to simply remove the |
Closed by #27083. |
And pass it through via
Series.copy
.The text was updated successfully, but these errors were encountered: