ColumnMode
Source¶
Bases: Enum
Whether a ColumnChoice keeps or drops the columns it names.
Added in version 0.1.0
Examples:
import numdaplot as ndp
cities = ndp.Array.from_list(["Paris", "Lyon", "Paris"])
prices = ndp.Array.from_list([120.0, 80.0, 150.0])
sales = ndp.Table.from_arrays({"city": cities, "price": prices})
sales.choose_columns(ndp.ColumnChoice(columns=["price"], mode=ndp.ColumnMode.DROP))
# city
# TEXT
# 0 Paris
# 1 Lyon
# 2 Paris
Attributes¶
KEEP = auto()
Source¶
Only the named columns remain, in the order of the list. Default value.
Added in version 0.1.0
Examples:
import numdaplot as ndp
cities = ndp.Array.from_list(["Paris", "Lyon", "Paris"])
prices = ndp.Array.from_list([120.0, 80.0, 150.0])
sales = ndp.Table.from_arrays({"city": cities, "price": prices})
sales.choose_columns(ndp.ColumnChoice(columns=["price"], mode=ndp.ColumnMode.KEEP))
# price
# FLOAT64
# 0 120.0
# 1 80.0
# 2 150.0
DROP = auto()
Source¶
The named columns are removed, the others keep their order.
Added in version 0.1.0
Examples:
import numdaplot as ndp
cities = ndp.Array.from_list(["Paris", "Lyon", "Paris"])
prices = ndp.Array.from_list([120.0, 80.0, 150.0])
sales = ndp.Table.from_arrays({"city": cities, "price": prices})
sales.choose_columns(ndp.ColumnChoice(columns=["price"], mode=ndp.ColumnMode.DROP))
# city
# TEXT
# 0 Paris
# 1 Lyon
# 2 Paris