core.matrix
core.matrix copied to clipboard
Selecting columns from datasets
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
@mschuene we should make sure this lines up well with your select functionality....
Yes, dataset could just implement the select protocol functions and accept column names there