mlr --csv put '$ratio = $salary / $score' data.csv
Add a computed ratio column to each row
The put verb adds a new field computed by an expression, here ratio equals salary divided by score for every row. New fields appear at the end of the record and are carried into the output. Expressions can reference any existing field with the dollar sign. This is the workhorse for deriving features on tabular data.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.