Title: implement Axis.astype · Issue #880 · larray-project/larray · GitHub
Open Graph Title: implement Axis.astype · Issue #880 · larray-project/larray
X Title: implement Axis.astype · Issue #880 · larray-project/larray
Description: I relatively often need to change an axis labels dtype. For example to convert labels to int64, I currently have to do: >>> arr = ndtest("a=1..3") >>> arr.a.dtype dtype('int32') >>> arr.set_labels('a', arr.a.labels.astype(np.int64)) >>> ...
Open Graph Description: I relatively often need to change an axis labels dtype. For example to convert labels to int64, I currently have to do: >>> arr = ndtest("a=1..3") >>> arr.a.dtype dtype('int32') >>> arr.set_labels(...
X Description: I relatively often need to change an axis labels dtype. For example to convert labels to int64, I currently have to do: >>> arr = ndtest("a=1..3") >>> arr.a.dtype dtype(...
Opengraph URL: https://github.com/larray-project/larray/issues/880
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"implement Axis.astype","articleBody":"I relatively often need to change an axis labels dtype. For example to convert labels to int64, I currently have to do:\r\n\r\n```python\r\n>>> arr = ndtest(\"a=1..3\")\r\n>>> arr.a.dtype\r\ndtype('int32')\r\n>>> arr.set_labels('a', arr.a.labels.astype(np.int64))\r\n>>> # this would be a tad shorter and makes sense IMO\r\n... arr.set_labels('a', arr.a.astype(np.int64))\r\n```\r\n\r\nIn an ideal world, `arr.set_labels('a', np.int64)` would work too (but I am unsure it is possible). It currently returns an object array for the axis labels:\r\n```python\r\n>>> arr.set_labels('a', np.int64).a.dtype\r\ndtype('O')\r\n```","author":{"url":"https://github.com/gdementen","@type":"Person","name":"gdementen"},"datePublished":"2020-08-04T09:46:53Z","url":"https://github.com/larray-project/larray/issues/880"}
| 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:8f1821bb-848c-1234-c987-7e2b00733028 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C4D6:2EC689:24511CA:31555C2:6B003277 |
| html-safe-nonce | a50f2c3408aa07d5c8fb2d0b318b9ce59b76780a6824e7ffdcd9af0e6f0d8de9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNEQ2OjJFQzY4OToyNDUxMUNBOjMxNTU1QzI6NkIwMDMyNzciLCJ2aXNpdG9yX2lkIjoiNjk4MTgwNzI2NTE3NTA1NzAxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4323085468ccaf3c138fa08d90e4c9772f19be9cd29e77b3c413e3bf56d23969 |
| hovercard-subject-tag | issue:672659554 |
| 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/880/issue_layout |
| twitter:image | https://opengraph.githubassets.com/75276546aaca17cbf52e0cf71d6f8a3f6bb7b450303e38bda43e12f7b2a4e3a7/larray-project/larray/issues/880 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/75276546aaca17cbf52e0cf71d6f8a3f6bb7b450303e38bda43e12f7b2a4e3a7/larray-project/larray/issues/880 |
| og:image:alt | I relatively often need to change an axis labels dtype. For example to convert labels to int64, I currently have to do: >>> arr = ndtest("a=1..3") >>> arr.a.dtype dtype('int32') >>> arr.set_labels(... |
| 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 | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width