Fork me on GitHub

With tablecloth, is a single column considered a "Series" in a way similar to pandas? I'm having trouble understanding why I can't use dfn/mean on a single column Dataset


Are you trying to use the whole Dataset object as an argument to dfn/mean? I don't think there's that kind of polymorphism built in - you'd have to call tablecloth.api/column or tablecloth.api/map-columns to operate on the column within the dataset.


There is no such polymorphism. You need to pass a column object, eg. (dfn/mean (ds :column-name))


So maybe my initial sin is using tc/select-colums to select only one column? That creates a Dataset, that's why I was trying to figure out if a single column becomes a "series" or something like that because it seems like that's what dfn/mean expects to operate on


select-columns creates a dataset with a subset of columns. To select a column use a dataset as a map or call tc/column . More about it here:


dfn/mean (and any other dfn functions) operates on a dtype-next buffer, Clojure sequence or a Column object but not on a dataset itself.


Thank you, by the way. tc/column solved everything

👍 1