Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add single column select #11

Closed
anthonymorast opened this issue Nov 22, 2021 · 3 comments
Closed

Add single column select #11

anthonymorast opened this issue Nov 22, 2021 · 3 comments

Comments

@anthonymorast
Copy link
Owner

anthonymorast commented Nov 22, 2021

For example, datatable::DataTable.col() which returns a single column datatable (no response variable) so these can be chained:

datatable::DataTable.col("colname").max()
datatable::DataTable.col("colname").min()

etc.

@anthonymorast
Copy link
Owner Author

Will need a min/max with the column specified and another without that only works on single column tables

@anthonymorast
Copy link
Owner Author

e.g.
// these two check for single column, error if column count > 0 "column is required for DataTables with multple columns"
T min();
T max();

T min(int col);
T max(int col);

@anthonymorast
Copy link
Owner Author

Single column selection was implemented via:

DataTable<T> operator[](std::string column) const;  // select column into DT

Example for min/max chaining:

datatable::DataTable<float> dt(...);
cout << dt["col1"].max() << endl;
cout << dt["col1"].min() << endl;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant