Title: Setitem does not support anonymous & wildcard axes · Issue #1202 · larray-project/larray · GitHub
Open Graph Title: Setitem does not support anonymous & wildcard axes · Issue #1202 · larray-project/larray
X Title: Setitem does not support anonymous & wildcard axes · Issue #1202 · larray-project/larray
Description: >>> target = ndtest((3, 4)) >>> value = ndtest((2, 3)).rename({0: None, 1: None}).ignore_labels() >>> target['a1':, 'b1':] = value ValueError: cannot reshape array of size 6 into shape (1,1) The underlying issue is that the value cannot ...
Open Graph Description: >>> target = ndtest((3, 4)) >>> value = ndtest((2, 3)).rename({0: None, 1: None}).ignore_labels() >>> target['a1':, 'b1':] = value ValueError: cannot reshape array of size 6 into shape (1,1) The un...
X Description: >>> target = ndtest((3, 4)) >>> value = ndtest((2, 3)).rename({0: None, 1: None}).ignore_labels() >>> target['a1':, 'b1':] = value ValueError: cannot resh...
Opengraph URL: https://github.com/larray-project/larray/issues/1202
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Setitem does not support anonymous & wildcard axes","articleBody":"```python\n>>> target = ndtest((3, 4))\n>>> value = ndtest((2, 3)).rename({0: None, 1: None}).ignore_labels()\n>>> target['a1':, 'b1':] = value\nValueError: cannot reshape array of size 6 into shape (1,1)\n```\n\nThe underlying issue is that the value cannot be broadcasted to the target axes:\n\n```python\n>>> value.broadcast_with(target['a1':, 'b1':].axes)\nValueError: cannot reshape array of size 6 into shape (1,1)\n```\n\nUnsure what it would take to fix this though.\n\nI discovered this in MOSES via `target[target_key] = excel_sheet[source_key]` which displays a warning:\n```\nFutureWarning: \nSetting a subset of an array with float64 dtype with a value with Range dtype.\n\nIt will be converted to float64 like in previous larray versions but this is \nnot a safe operation (some information could be lost in the conversion). \n\nIf you want to keep doing this conversion and silence this warning, please\nconvert the value explicitly using value.astype(\u003ctarget_array_type>). \n\nThis warning will become an error in a future version of larray.\n```\n\nbut using `target[target_key] = excel_sheet[source_key].astype('float')` triggers the bug.\n\nI think that since Range objects implement an `__larray__` method, the warning should have been different (should mention object dtype in the case of MOSES because the value contains None => nans), instead of \"Range dtype\" because it should have converted the Range to an Array via asarray. Would not have solved the warning (because of the object dtype) nor the broadcasting problem but at least it would have done what it should 😉 ","author":{"url":"https://github.com/gdementen","@type":"Person","name":"gdementen"},"datePublished":"2026-07-10T12:57:35Z","url":"https://github.com/larray-project/larray/issues/1202"}
| 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:10e214d2-be3c-b02f-c9ff-03492fd2c906 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 89C0:5875E:1FC6987:2B1FE00:6B00199C |
| html-safe-nonce | 03b3fca775f802adcd6606dad5a3a503a9bb6cd479bdf401b42f86a82bb873d7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OUMwOjU4NzVFOjFGQzY5ODc6MkIxRkUwMDo2QjAwMTk5QyIsInZpc2l0b3JfaWQiOiIyMDk0MTQ3MjA4MzE1MTQ4NzAwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f7345cb761506c27838e9fddf227122c97162c01863ef9b1ec998ec555fe5293 |
| hovercard-subject-tag | issue:4855197399 |
| 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/1202/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fc13adcc230170d753a626df6243460033b5ea0f0d7cadeb9ee15da7fbd734d2/larray-project/larray/issues/1202 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fc13adcc230170d753a626df6243460033b5ea0f0d7cadeb9ee15da7fbd734d2/larray-project/larray/issues/1202 |
| og:image:alt | >>> target = ndtest((3, 4)) >>> value = ndtest((2, 3)).rename({0: None, 1: None}).ignore_labels() >>> target['a1':, 'b1':] = value ValueError: cannot reshape array of size 6 into shape (1,1) The un... |
| 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 | a2dd2291b1b13cc9c06f27ec92fa3dbaf34116fc24c9347b8539db61884c59f4 |
| 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 | 70121d4e855ee0bb7b75cf15d061d91f8863c0f8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width