Table.use_first_row_as_names
use_first_row_as_nameson_problems
Group: Metadata
Aliases: header
, rename
Documentation
Returns a new table with the columns renamed based on entries in the first row, and then the first row is removed.
Arguments
on_problems
: Specifies how to handle problems if they occur, reporting them as warnings by default.
Returns
- A new table with the columns renamed based on the first row.
Examples
Rename the column based on the first row
table = Table.from_rows ["bar","foo","buzz","bizz"] [["John", "25","abc","123"]]
output = table.use_first_row_as_names
Returns a Table
bar | foo | buzz | bizz |
---|---|---|---|
John | 25 | abc | 123 |
Errors
- If any of the new names are invalid (e.g.
Nothing
or ``""), an
Invalid_Column_Names`. - If any of the new names clash either with existing names or each
other, a
Duplicate_Output_Column_Names
.