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

Dataset.subset interface badly explained, works only if headers are set #366

Open
dheller1 opened this issue May 25, 2019 · 1 comment
Open

Comments

@dheller1
Copy link

It took me quite a while to figure out how to use Dataset.subset.

The documentation states the interface is subset(rows=None, cols=None), so my first assumption was to just pass two ints for the number of requested rows and columns, and when that didn't work I passed a list of column indices, but also to no avail.

Only after debugging I finally found out that I first need to define column headers for the Dataset instance and then pass a subset of these headers to cols.

In my opinion, this could be made more clearly in the documentation.
Also, is there a reason why headers are required and we cannot alternatively just pass column indices?

I would go ahead and try to implement that myself if you don't mind.

@tribals
Copy link

tribals commented Feb 9, 2022

Still didn't understood how to use it...

I need just a slice of Dataset but returned as another Dataset instance.That's what "Pythonic" means. If you make Dateset to behave as, say, list, then do it all the way. So, I could for example take a subset of my data then convert it into another format. Returning list from slice is just ugly.

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

3 participants