core.matrix icon indicating copy to clipboard operation
core.matrix copied to clipboard

Selecting columns from datasets

Open mikera opened this issue 11 years ago • 2 comments

It is very useful to have a convenient way to select columns from a Dataset-like structure.

Syntax idea:

(select-columns DATA ["Name" "Age" "Height"])
=> [a Nx3 matrix taking the name, age and height columns in that order from DATA]

Logic for selecting columns would be:

  • If the selection value is a number, take the numbered column from the dimension as usual
  • Otherwise, look up the column in the dataset column names
  • Throw an error if the column is still not found

mikera avatar Apr 17 '14 03:04 mikera

@mschuene we should make sure this lines up well with your select functionality....

mikera avatar Apr 17 '14 04:04 mikera

Yes, dataset could just implement the select protocol functions and accept column names there

mschuene avatar Apr 17 '14 19:04 mschuene