Title: add some better api to specify number_format when dumping data to Excel · Issue #1162 · larray-project/larray · GitHub
Open Graph Title: add some better api to specify number_format when dumping data to Excel · Issue #1162 · larray-project/larray
X Title: add some better api to specify number_format when dumping data to Excel · Issue #1162 · larray-project/larray
Description: The current way to do it: with open_excel(fpath) as wb: sheet = wb[0] sheet['A1'] = arr.dump() # we must use Excel "custom format" syntax sheet['B2'].xw_range.expand().number_format = '0,00' # OR sheet.range('B2').expand().number_format ...
Open Graph Description: The current way to do it: with open_excel(fpath) as wb: sheet = wb[0] sheet['A1'] = arr.dump() # we must use Excel "custom format" syntax sheet['B2'].xw_range.expand().number_format = '0,00' # OR s...
X Description: The current way to do it: with open_excel(fpath) as wb: sheet = wb[0] sheet['A1'] = arr.dump() # we must use Excel "custom format" syntax sheet['B2'].xw_range.expand().num...
Opengraph URL: https://github.com/larray-project/larray/issues/1162
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"add some better api to specify number_format when dumping data to Excel","articleBody":"The current way to do it:\n\n```python\nwith open_excel(fpath) as wb:\n sheet = wb[0]\n sheet['A1'] = arr.dump()\n # we must use Excel \"custom format\" syntax\n sheet['B2'].xw_range.expand().number_format = '0,00'\n # OR\n sheet.range('B2').expand().number_format = '0,00'\n # OR\n sheet['B2:D3'].number_format = '0,00'\n\n # for percents:\n sheet['B2:D3'].number_format = '0,0%'\n```\n\nBut it is annoying to have to specify the range of the data, or even the \"starting point\" of the data.\n\n* Technically, I think we will need to make Array.dump() return a \"Dump\" object instead of a simple list and implement a custom xlwings converter.\nhttps://docs.xlwings.org/en/stable/converters.html#custom-converter\n* For the API, I imagine something like (but this needs more thoughts):\n```python\nwith open_excel(fpath) as wb:\n sheet = wb[0]\n sheet['A1'] = arr.dump(data_format='0,00')\n```\n\nSolving this issue would probably add the infrastructure necessary to solve #646 easily.\n\nWe might want to tackle this at the same time than the various Excel API refactors (#826, #900, #926, #967, #1005).\n\nWe might want to be even more ambitious and implement something like Pandas Styler but that would take a long time until we have time to design such a large system (unless we just reuse the Pandas design -- but I am unsure it applies)\nhttps://pandas.pydata.org/pandas-docs/stable/user_guide/style.html#Table-Visualization","author":{"url":"https://github.com/gdementen","@type":"Person","name":"gdementen"},"datePublished":"2026-02-16T14:26:30Z","url":"https://github.com/larray-project/larray/issues/1162"}
| 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:9369797d-1579-a812-805c-49ae30a86794 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CF22:163716:20FFCBD:2CD9155:6B002127 |
| html-safe-nonce | 2ac4b39d9f6c418feb7e1a6b84b6e6b65c31d8eedc9e87f14700aa35cf275bc8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjIyOjE2MzcxNjoyMEZGQ0JEOjJDRDkxNTU6NkIwMDIxMjciLCJ2aXNpdG9yX2lkIjoiNzQ3NzQ0OTMxNzIyMTkzMzM1MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 555ffd18a75ad2bf4267293b03efd36d45395b72530fadf61748913b96d57d8b |
| hovercard-subject-tag | issue:3948034071 |
| 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/1162/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fa236f682c5d559eef96ac433ed60e98c0c1f1ab60a51260cac60b91703a9b23/larray-project/larray/issues/1162 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fa236f682c5d559eef96ac433ed60e98c0c1f1ab60a51260cac60b91703a9b23/larray-project/larray/issues/1162 |
| og:image:alt | The current way to do it: with open_excel(fpath) as wb: sheet = wb[0] sheet['A1'] = arr.dump() # we must use Excel "custom format" syntax sheet['B2'].xw_range.expand().number_format = '0,00' # OR 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