ColumnExtract
Selects the desired columns to remain in the target dataframe and removes the other columns. The columns to extract can be specified by name or column index. This is useful when a dataset has excess columns that are not needed for the current analysis and you only want to focus on columns of interest.
Options
columns: Specifies the columns to extract data for
Examples
Example 1 - Extract a Single Column from a Dataframe
Sometimes you only need one specific column from a dataframe to simplify downstream operations. This example shows how to isolate the DeviceID column and drop the rest of the dataset.
#> ColumnExtract DeviceID
AFLEFT
bankTransactionsDf = bankTransactionsDf[ [ 'DeviceID' ] ] AFRIGHT
Example 2 - Extract Multiple Columns from a Dataframe
In many cases, you want to keep only a subset of columns that are relevant for your analysis. This example shows how to extract three specific columns: Location, AccountBalance, and TransactionDuration.
#> ColumnExtract Location AccountBalance TransactionDuration
AFLEFT
bankTransactionsDf = bankTransactionsDf[ [ 'Location', 'AccountBalance', 'TransactionDuration' ] ] AFRIGHT