scicloj / tablecloth

Dataset manipulation library built on the top of tech.ml.dataset
https://scicloj.github.io/tablecloth
MIT License
305 stars 27 forks source link

pivot->wider does not respect datatype of values of selector-column #89

Closed behrica closed 2 years ago

behrica commented 2 years ago
(tc/pivot->wider (tc/dataset {:class-name [0 1]
                                      :probability [0.3 0.3]})
                         [:class-name]
                         [:probability])

produces a dataset with columns ["0", "1"]. I would expect to get column [0,1]

genmeblog commented 2 years ago

Hmmm... I'm pretty sure I've made it already. I'll verify this soon, thanks.

From the Changelog:

[6.094]
Added
- crosstab - cross tabulation
- pivot->longer :coerce-to-number option added
Changed
- [breaking] pivot->wider no longer coerces column names to strings, it's up to user
behrica commented 2 years ago

I was somehow in an older tablecloth. Latest version is working as expected.