One would expect the following to create a dataset with 2 columns and rows populated with the data from each tuple, but you get an unexpected result (a 3x2 dataset)
(tc/dataset [["a" 2] ["b" 3] ["c" 4]] {:column-names ["Col A" "Col B"]})
;; >>>
| a | b | c |
|--:|--:|--:|
| 2 | 3 | 4 |
(as opposed to)
| Col A | Col B |
|------:|------:|
| a | 2 |
| b | 3 |
| c | 4 |
One possible solution is to just remove this special handling of 2-element iterables and issue a breaking release, another might be to handle the case where a map is given (which seems to be what this is trying to catch, I think?), but not apply the same logic to all 2-element seqs (which would still be a breaking change).
I'd be happy to contribute a PR once a decision is made about if/how to address this issue.
One would expect the following to create a dataset with 2 columns and rows populated with the data from each tuple, but you get an unexpected result (a 3x2 dataset)
(as opposed to)
The offending lines of code are here: https://github.com/scicloj/tablecloth/blob/master/src/tablecloth/api/dataset.clj#L75-L79
One possible solution is to just remove this special handling of 2-element iterables and issue a breaking release, another might be to handle the case where a map is given (which seems to be what this is trying to catch, I think?), but not apply the same logic to all 2-element seqs (which would still be a breaking change).
I'd be happy to contribute a PR once a decision is made about if/how to address this issue.