Operating columns
To understand column operations, first, we'll look at some of the most common operations, which are for selecting columns. In Optimus, you have the powerful select
function, which provides multiple options for managing most selection cases.
Selecting columns
The simplest use case for selecting a column is using its name:
df.cols.select("job").print()
You will get the job column data in response:
job (object) ---------- Leader Espionage 1 3
If you want to select multiple columns by their whole names, you can use a Python list, like so:
df.cols.select(["name", "job"]).print()
This will return the name
and job
column data:
name job (object) (object) ---------- ---------- optimus Leader bumblebee Espionage eject 1 2 ...