-
Notifications
You must be signed in to change notification settings - Fork 92
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
3917 copy function to match numpy #3925
base: master
Are you sure you want to change the base?
3917 copy function to match numpy #3925
Conversation
2297a4c
to
9b2eee0
Compare
c0067d1
to
c990e15
Compare
c990e15
to
cb7d2ec
Compare
|
||
if isinstance(a, Strings): | ||
cpy = a[:] | ||
return cpy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call Strings.copy()
if copy is False: | ||
if isinstance(a, (Strings, pdarray)): | ||
return a | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the dtype.
@@ -192,6 +199,7 @@ def array( | |||
to create the Strings object and the two corresponding pdarrays for string | |||
bytes and offsets, respectively. | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add more comments about why we are changing from numpy.
Creates a copy function to match numpy:
https://numpy.org/doc/2.1/reference/generated/numpy.copy.html
Also modifies the
array
function to operate onStrings
, and to have a copy argument. Whencopy=False
, the original array will be returned, rather than a copy, if possible.Closes #3917 copy function to match numpy