Title: better support for duplicate labels (on the same axis) · Issue #1126 · larray-project/larray · GitHub
Open Graph Title: better support for duplicate labels (on the same axis) · Issue #1126 · larray-project/larray
X Title: better support for duplicate labels (on the same axis) · Issue #1126 · larray-project/larray
Description: We cannot load >2D array with duplicate labels: arr = ndtest("a=a0,a1;b=x,x;c=c0,c1") arr.to_hdf('test.h5', 'arr') arr = read_hdf('test.h5', 'arr') ValueError: cannot reshape array of size 8 into shape (2,1,2) arr.to_csv('test.csv') arr ...
Open Graph Description: We cannot load >2D array with duplicate labels: arr = ndtest("a=a0,a1;b=x,x;c=c0,c1") arr.to_hdf('test.h5', 'arr') arr = read_hdf('test.h5', 'arr') ValueError: cannot reshape array of size 8 into s...
X Description: We cannot load >2D array with duplicate labels: arr = ndtest("a=a0,a1;b=x,x;c=c0,c1") arr.to_hdf('test.h5', 'arr') arr = read_hdf('test.h5', 'arr') Valu...
Opengraph URL: https://github.com/larray-project/larray/issues/1126
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"better support for duplicate labels (on the same axis)","articleBody":"We cannot load >2D array with duplicate labels:\r\n \r\n```python\r\narr = ndtest(\"a=a0,a1;b=x,x;c=c0,c1\")\r\n\r\narr.to_hdf('test.h5', 'arr')\r\narr = read_hdf('test.h5', 'arr')\r\nValueError: cannot reshape array of size 8 into shape (2,1,2)\r\n\r\narr.to_csv('test.csv')\r\narr = read_csv('test.csv')\r\nValueError: cannot handle a non-unique multi-index!\r\n\r\narr.to_excel('test.xlsx')\r\narr = read_excel('test.xlsx')\r\nValueError: cannot handle a non-unique multi-index!\r\n```\r\n\r\nFor HDF, this is clearly a limitation in larray's code. In pandas.py/index_to_labels, I used the following code:\r\n\r\n```python\r\nreturn [unique_list(idx.get_level_values(label)) for label in range(idx.nlevels)]\r\n```\r\n\r\nwhere unique_list returns the unique labels for that index \"level\", and that obviously breaks in the presence of duplicate labels.\r\n\r\nFor csv and Excel, this is not so clear-cut. This seems to be a limitation in Pandas reindex, and I am unsure we can do anything about that (except not going via Pandas to load data).","author":{"url":"https://github.com/gdementen","@type":"Person","name":"gdementen"},"datePublished":"2024-12-11T07:39:14Z","url":"https://github.com/larray-project/larray/issues/1126"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7f8ba9f9-c82a-5bec-c348-6e56d3ddd682 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF00:2D8191:174097:1ECAE7:6B001F98 |
| html-safe-nonce | 5477fc08f8944a86f9bce5f2c00108e66a5cd9d3e4a8569f4366c10bd48fb82a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjAwOjJEODE5MToxNzQwOTc6MUVDQUU3OjZCMDAxRjk4IiwidmlzaXRvcl9pZCI6Ijc3MDUyMjcyODU2NTMxMDI0ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2034d8aed59f2a744ca23d10186a78889af1305d916b0d1d77e20e49d9d7a219 |
| hovercard-subject-tag | issue:2732086763 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/larray-project/larray/1126/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c124cfac68e8c1b50c35fb843b0de3b5b11ee2eda1a17c023a6eda3deeed232a/larray-project/larray/issues/1126 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c124cfac68e8c1b50c35fb843b0de3b5b11ee2eda1a17c023a6eda3deeed232a/larray-project/larray/issues/1126 |
| og:image:alt | We cannot load >2D array with duplicate labels: arr = ndtest("a=a0,a1;b=x,x;c=c0,c1") arr.to_hdf('test.h5', 'arr') arr = read_hdf('test.h5', 'arr') ValueError: cannot reshape array of size 8 into s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gdementen |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/larray-project/larray git https://github.com/larray-project/larray.git |
| octolytics-dimension-user_id | 26460981 |
| octolytics-dimension-user_login | larray-project |
| octolytics-dimension-repository_id | 16981067 |
| octolytics-dimension-repository_nwo | larray-project/larray |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16981067 |
| octolytics-dimension-repository_network_root_nwo | larray-project/larray |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width