-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
BugDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsIO Excelread_excel, to_excelread_excel, to_excel
Milestone
Metadata
Metadata
Assignees
Labels
BugDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsIO Excelread_excel, to_excelread_excel, to_excel
Type
Projects
Relationships
Development
Select code repository
Activity
jreback commentedon Apr 3, 2014
do
nans
raise the same? or justinf
?jreback commentedon Apr 3, 2014
cc @jmcnamara
arthurgerigk-rocket commentedon Apr 3, 2014
nans are fine
On Thu, Apr 3, 2014 at 7:19 PM, jreback notifications@github.com wrote:
Arthur Gerigk
Global CMO
Rocket Internet GmbH | Johannisstraße 20 | 10117 Berlin | Deutschland
Mobile: +49 162 290 46 39 | skype: arthur.gerigk | mail:
arthur.gerigk@rocket-internet.de
www.rocket-internet.de
Geschäftsführer: Dr. Johannes Bruder, Arnt Jeschke, Alexander Kudlich
Eingetragen beim Amtsgericht Berlin, HRB 109262 USt-ID DE256469659
jmcnamara commentedon Apr 3, 2014
I don't think NAN/INF are supported by Excel so I am curious to see what OpenPyXL is doing in this case.
Can you post a small example that demonstrates the issue and I'll look into it.
arthurgerigk-rocket commentedon Apr 3, 2014
to_excel has a parameter "na_rep" which defaults to the empty string.
actually there are NA values in excel
http://office.microsoft.com/en-001/excel-help/na-HP005209188.aspx
On Thu, Apr 3, 2014 at 7:39 PM, John McNamara notifications@github.comwrote:
Arthur Gerigk
Global CMO
Rocket Internet GmbH | Johannisstraße 20 | 10117 Berlin | Deutschland
Mobile: +49 162 290 46 39 | skype: arthur.gerigk | mail:
arthur.gerigk@rocket-internet.de
www.rocket-internet.de
Geschäftsführer: Dr. Johannes Bruder, Arnt Jeschke, Alexander Kudlich
Eingetragen beim Amtsgericht Berlin, HRB 109262 USt-ID DE256469659
jmcnamara commentedon Apr 3, 2014
NA is only supported in Excel as a formula or as the result of a formula. Not as a value.
If you post an example I'll have a look at it.
arthurgerigk-rocket commentedon Apr 3, 2014
import numpy as np
import pandas as pd
df = pd.DataFrame([(1, np.nan), (2, 3)])
df.to_excel('test.xlsx') # works
df = pd.DataFrame([(1, np.inf), (2, 3)])
df.to_excel('test2.xlsx') # fails
since there is a parameter np_rep I think it has to work ;-)
On Thu, Apr 3, 2014 at 8:14 PM, John McNamara notifications@github.comwrote:
Arthur Gerigk
Global CMO
Rocket Internet GmbH | Johannisstraße 20 | 10117 Berlin | Deutschland
Mobile: +49 162 290 46 39 | skype: arthur.gerigk | mail:
arthur.gerigk@rocket-internet.de
www.rocket-internet.de
Geschäftsführer: Dr. Johannes Bruder, Arnt Jeschke, Alexander Kudlich
Eingetragen beim Amtsgericht Berlin, HRB 109262 USt-ID DE256469659
jtratner commentedon Apr 5, 2014
Let's follow the model of
to_csv
/read_csv
and outputnp.inf
as the string'inf'
, which will be able to be round-tripped appropriately.Side note - I can't open up the openpyxl file after it's written - so I'm not sure if openpyxl is doing the right thing.