Title: Improve error message when setting an Array subset with an unlabelled array-like of incorrect shape · Issue #1169 · larray-project/larray · GitHub
Open Graph Title: Improve error message when setting an Array subset with an unlabelled array-like of incorrect shape · Issue #1169 · larray-project/larray
X Title: Improve error message when setting an Array subset with an unlabelled array-like of incorrect shape · Issue #1169 · larray-project/larray
Description: Currently users get the raw message from numpy in that case: >>> import numpy as np >>> arr = ndtest((2, 3)) >>> arr['a0'] = np.array([1, 2]) ValueError: could not broadcast input array from shape (2,) into shape (3,) But we could help d...
Open Graph Description: Currently users get the raw message from numpy in that case: >>> import numpy as np >>> arr = ndtest((2, 3)) >>> arr['a0'] = np.array([1, 2]) ValueError: could not broadcast input array from shape ...
X Description: Currently users get the raw message from numpy in that case: >>> import numpy as np >>> arr = ndtest((2, 3)) >>> arr['a0'] = np.array([1, 2]) ValueError: could no...
Opengraph URL: https://github.com/larray-project/larray/issues/1169
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve error message when setting an Array subset with an unlabelled array-like of incorrect shape","articleBody":"Currently users get the raw message from numpy in that case:\n\n```python\n>>> import numpy as np\n>>> arr = ndtest((2, 3))\n>>> arr['a0'] = np.array([1, 2])\nValueError: could not broadcast input array from shape (2,) into shape (3,)\n```\n\nBut we could help debugging by providing the labels of the target subset in the error message.\n\n```python\n>>> arr['a0'].axes\nAxisCollection([\n Axis(['b0', 'b1', 'b2'], 'b')\n])\n```\n\nThis kind of issue is more frequent than one could think as our users encounter it when loading \"raw\" (unlabelled) data from Excel via: \n\n```python\n>>> with open_excel() as wb:\n... sheet = wb[0]\n... # add some data (no dump => no labels)\n... sheet[:] = ndtest((2, 3))\n... arr['a0'] = sheet['A1:B1']\nValueError: could not broadcast input array from shape (2,) into shape (3,)\n```\n","author":{"url":"https://github.com/gdementen","@type":"Person","name":"gdementen"},"datePublished":"2026-03-10T10:15:24Z","url":"https://github.com/larray-project/larray/issues/1169"}
| 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:822c6880-e650-a080-456f-2263018698c4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BE40:3204C8:2CEA9A2:3B231B2:6B001BEC |
| html-safe-nonce | 18742543c7917469c4f6551e000b41e1b372f1b3b78a889d466c45d4ccc5023b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTQwOjMyMDRDODoyQ0VBOUEyOjNCMjMxQjI6NkIwMDFCRUMiLCJ2aXNpdG9yX2lkIjoiMjM2NTM4NDc3Mzk5MzUwMzcyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4b7c6615bfedb0c9acaa9d887a5292d83ba9e53f080b508aa13afdce08c9e256 |
| hovercard-subject-tag | issue:4050770672 |
| 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/1169/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8bb8e08eaf57ce83c17f0a3cd8da0fe126810c2943b0db3d5ad95588c48cfd0c/larray-project/larray/issues/1169 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8bb8e08eaf57ce83c17f0a3cd8da0fe126810c2943b0db3d5ad95588c48cfd0c/larray-project/larray/issues/1169 |
| og:image:alt | Currently users get the raw message from numpy in that case: >>> import numpy as np >>> arr = ndtest((2, 3)) >>> arr['a0'] = np.array([1, 2]) ValueError: could not broadcast input array from shape ... |
| 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