-
Notifications
You must be signed in to change notification settings - Fork 64
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 additional selection helpers. #34
Comments
Thanks! I've created a PR that adds more selection helpers ( As for more advanced renaming support, you can always add (and share!) your own utilities outside of the core Arquero library. For example: function normalize_name(str) {
// perform custom column name normalization
}
// create a mapping of original column names to normalized names
const nameMap = {};
table.columnNames.forEach(s => nameMap[name] = normalize_name(s));
// rename the columns
const newTable = table.select(nameMap); |
Thank you for the suggestion, so here is my share for normalizing table columns names:
|
Thanks for sharing! @ericemc3, do you mind if I later add this (or a minor revision thereof) to the Arquero Cookbook? If that's OK, let me know how you'd like me to acknowledge your contribution (by name, GitHub id, Observable id, or...?). |
My pleasure, you can of course reuse this as you want. I published them on https://observablehq.com/@ericmauviere/arquero-table-utils |
I added a new utility function for renaming columns :
|
New selection helpers now staged for v1.2.0. |
These are suggestions from a R practice, with handy functionalities i frequently use:
select
current possibilities such as selecting by name, indices,
not
,range
are excellent. I'd like also:starts_with
,contains
, and the possibility to test on column types (for instance select all numeric columns)rename
of course select in Arquero allows to rename, i have noticed that.
Within R, janitor::clean_names is very useful for tidying and fixing complex column_names that you can find, sometimes, in CSV files (with blanks, accented characters, caps) => DB compliant column names (one single world, lowercase, without accented or special chars...)
The text was updated successfully, but these errors were encountered: