withColumns method

DataFrame withColumns(
  1. List<String> columnNames, {
  2. bool asView = true,
})

Returns a DataFrame comprised of a subset of present columns specified by columnNames.

asView set to true leads to a view of the current data being returned, otherwise a copy will be returned.

Implementation

DataFrame withColumns(List<String> columnNames, {bool asView = true}) =>
    _viewOrCopy(
        columnNames, columnNames.map((e) => this(e)).transposed(), asView);