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

Problem with missing values #49

Open
ghost opened this issue Mar 6, 2018 · 3 comments
Open

Problem with missing values #49

ghost opened this issue Mar 6, 2018 · 3 comments
Milestone

Comments

@ghost
Copy link

ghost commented Mar 6, 2018

Hi,

I would like to read values from A1:B2 cells using readxl with following script:

using ExcelReaders

path = Base.Filesystem.joinpath(@__DIR__, "test.xlsx")
range = "test!A1:B2"

data = ExcelReaders.readxl(path, range)
dump(data)

Currently the script works fine if the values are there and I get PyError in case values are missing. I would like to get 2x2 array regardless if the values are there or not.

I tried to use readxlsheet like this:

data = ExcelReaders.readxlsheet(path, "test"; skipstartrows=0, skipstartcols=0, nrows=2, ncols=2)
dump(data)

but I get 0x0 array in case data is missing.

Thanks,
Piotr

@davidanthoff
Copy link
Member

Hm, I'm not sure we should do this... There is a difference between a cell that is defined but has no data in it (which we handle correctly), and a situation where a cell is just not defined at all because you are indexing into a location outside of the size of the sheet. I think the fact that the underlying python lib also errors if one tries to access this is probably a good precedent to follow.

I'll leave this open in case others want to chime in as well.

@davidanthoff davidanthoff added this to the Backlog milestone Mar 6, 2018
@ghost
Copy link
Author

ghost commented Mar 7, 2018

Thanks for the reply, for the time being I will do without this feature.
Just to understand a bit more. When is the cell considered to be defined - when it has value or some formatting?

@davidanthoff
Copy link
Member

I'm not entirely clear what the semantics are, but at least from the python lib point of view there seems to be a difference between a cell existing and a cell existing but not having a value.

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

No branches or pull requests

1 participant