Skip to content
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

Integers coerce to Floats when creating a dataset from an xls document #410

Closed
MawiraIke opened this issue Nov 20, 2019 · 4 comments
Closed

Comments

@MawiraIke
Copy link
Contributor

MawiraIke commented Nov 20, 2019

I have created an xls document with only integers in its cells but when I read it using Incanters read-xls function, all the values/cells are coerced to floats.

A previous issue #248 mentioned about integers being coerced to floats when creating a dataset from a map but it seems like that was fixed. I realized this while i was checking issue #273 which i think is still embodied in this issue.

Edit: This is not causing issues in my program but I'm just wondering why this happens, or if there is a way to prevent this from happening.

@MawiraIke
Copy link
Contributor Author

Seems like there is a bug in the read-xls function. After altering my xls file to include other data types such as multiple-decimal floats, nil and some empty fields it seems like the dataset created contains a lot of wrong data as shown by the image below. The data on the left is the original data, the window shows incanters read dataset.

Real vs incanters data.

@joinr
Copy link

joinr commented Feb 15, 2020

Just perusing. Yea, the underlying format in Excel is that everything is a float (I believe). So values from apache POI are going to coerce to floats. I handle this via some additional parsing by default. I think there may be specifically tagged types of integers in Excel, but they're stored as floats maybe.

@MawiraIke
Copy link
Contributor Author

MawiraIke commented Feb 17, 2020 via email

@MawiraIke
Copy link
Contributor Author

I am going to close this issue because i cannot reproduce the wrong values error after trying with new excel files, even with multiple data types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants