Data.reorder_columns

Data.reorder_columns(cols, headers_too=True, setas_too=True)

Construct a new data array from the original data by assembling the columns in the order given.

Parameters:
  • datafile (Data) – Data object to work with if not being used as a bound method.

  • cols (list of column indices) – (referred to the oriignal data set) from which to assemble the new data set

  • headers_too (bool) – Reorder the column headers in the same way as the data (defaults to True)

  • setas_too (bool) – Reorder the column assignments in the same way as the data (defaults to True)

Returns:

datafile – A copy of the modified DataFile object