Skip to content
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

ENH: Provide functions to convert the axes of object arrays to and from lists #15091

Closed
wants to merge 4 commits into from

Conversation

psimaj
Copy link

@psimaj psimaj commented Dec 10, 2019

Closes #14478.
This pull request implements functionalities asked for in #14478.
I decided to implement the function converting arrays to arrays of lists in a way that allows choosing the axis to convert, as if we always converted the last (or next-to-last, depending how we look at it) axis, then those functions wouldn't be inverses of eachother; for example, converting
array([list([[1, 2], [3, 4]])])
with array_of_lists_to_array results in
array([[[1, 2], [3, 4]]])
but converting the last axis of the above array into lists would yield
array([[list([1, 2]), list([3, 4])]])
which is different to what we started with.
I would greatly appreciate opinions on the above change and regarding the names of the functions and their placement in the project structure (currently placed in lib/shape_base.py).

@psimaj
Copy link
Author

psimaj commented Dec 30, 2019

@eric-wieser Could you please take a look at and review this PR? I see that some tests aren't passing, but I am not sure what exactly is wrong (locally everything passed) and it's my first PR, so I'd appreciate a little guidance.

@charris
Copy link
Member

charris commented Dec 30, 2019

Should probably run this past the numpy mailing list.

Base automatically changed from master to main March 4, 2021 02:04
@InessaPawson
Copy link
Member

@psimaj Thank you for sharing your ideas! If you'd like to move this PR forward, I recommend asking for feedback on the NumPy mailing list: https://mail.python.org/archives/list/numpy-discussion@python.org/.

@mattip
Copy link
Member

mattip commented Jul 3, 2024

I think we should close this, as neither the issue nor the PR gained much traction.

@rossbar
Copy link
Contributor

rossbar commented Jul 3, 2024

I'll go ahead and close this - if there's strong desire to push this idea forward, following up with the mailing list seems like a good place to start.

@rossbar rossbar closed this Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Pending author's response
Development

Successfully merging this pull request may close these issues.

Provide functions to convert the last axis of object arrays to and from lists
6 participants