-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: na_rep='=na()' as default value #52258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Running
in LibreOffice on Ubuntu, I get When I upload the same sheet to Google Docs, the values appear as expected Is this just an issue with LibreOffice? I'd be hesitant to have this as a default without it working in the major Excel programs. |
Surprising, as Have you tried using directly the But ... well ... the major Excel program is ... Excel. I don't want to debate about spreadsheets programs, but Excel file is the file format for Excel, which is supported by other programs ... who are natively using the open document fomat. |
If this change is known to degrade the behavior for some users, then I'm rather negative toward it. Perhaps it's a bug in LibreOffice that can be fixed and then we can implement. |
Using Ctrl-Shift-F9 in LibreOffice resolves the values. Perhaps this is not done by default for security concerns? A much larger issue is that this breaks round tripping. If you do not open the Excel file and evaluate the formulas, they resolve to 0 upon reading.
If I instead open the written Excel file and evaluate formulas, I get the expected results.
Unless there is a way to appropriately roundtrip the NaN here without having to open the file, I don't think |
Finally, is it rejected ? |
That is how I would vote, the number one drawback in my mind is with round-tripping. However the idea does have some merit, and I do not like closing such issues without opinions from others. I'll mark it as a closing candidate for now. |
Thanks
|
I would also vote -1 for this feature, especially as a default behavior that is spreadsheet program dependent. Since there's been lack of interest from the core team on this for a while, closing |
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
Hello,
Excel has a formula for N/A: =na(). If is shown as #N/A.
Why not using this as default value for na_rep instead of ''?
So:
df.to_excel('foobar.xlsx', na_rep='=na()')
Thanks a lot,
Michaël
Feature Description
def df.to_excel(..., na_rep='=na()', ...)
Alternative Solutions
N/A
Additional Context
No response
The text was updated successfully, but these errors were encountered: