jazzband / jazzband/tablib

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

Open
#366 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4.8k
Forks
617
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.