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

failure printing series containing a segarray #3222

Closed
stress-tess opened this issue May 22, 2024 · 1 comment · Fixed by #3240
Closed

failure printing series containing a segarray #3222

stress-tess opened this issue May 22, 2024 · 1 comment · Fixed by #3240
Assignees
Labels
bug Something isn't working

Comments

@stress-tess
Copy link
Member

I discovered this when working with dataframes containing segarrays since the recent change in df indexing (see #3109) has changed what is returned

>>> test_df = ak.DataFrame({'test': ak.SegArray(ak.arange(10), ak.arange(10))})
>>> sa = test_df['test']
>>> sa
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
...
ValueError: 2

>>> sa.values
SegArray([
[0]
[1]
[2]
...
[7]
[8]
[9]
])
@stress-tess stress-tess added the bug Something isn't working label May 22, 2024
@stress-tess stress-tess self-assigned this May 22, 2024
stress-tess added a commit to stress-tess/arkouda that referenced this issue May 27, 2024
This PR fixes Bears-R-Us#3222, the series of segaray print bug. The bug was due to pandas series erroring an ndarray where each element is a list, but it handles a list of lists just fine. So we just call `to_list` instead of `to_ndarray` for the segarray case
@stress-tess
Copy link
Member Author

The actual issue ended up being in the to_pandas function

stress-tess added a commit to stress-tess/arkouda that referenced this issue May 28, 2024
This PR fixes Bears-R-Us#3222, the series of segaray print bug. The bug was due to pandas series erroring an ndarray where each element is a list, but it handles a list of lists just fine. So we just call `to_list` instead of `to_ndarray` for the segarray case
github-merge-queue bot pushed a commit that referenced this issue May 29, 2024
* Fixes 3222: series of segarray print bug

This PR fixes #3222, the series of segaray print bug. The bug was due to pandas series erroring an ndarray where each element is a list, but it handles a list of lists just fine. So we just call `to_list` instead of `to_ndarray` for the segarray case

* added test in response to PR feedback

---------

Co-authored-by: Tess Hayes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant