ChoiceGenerator#

class caf.toolkit.pandas_utils.random.ChoiceGenerator(name, length, values, all_values=False)[source]#

Generates data using a list of allowed values.

Attributes

values

Values to select for data values

all_values

Whether to ensure the resultant data contains all elements defined in values.

name

Name to be used as resultant series label.

length

Number of rows to create.

Methods

__init__(name, length, values[, all_values])

generate(generator)

Generate data using the generator provided and specifications define in the attributes.

Attributes Documentation

Parameters:
values: set[int | str][source]#

Values to select for data values

all_values: bool[source]#

Whether to ensure the resultant data contains all elements defined in values.

name: str[source]#

Name to be used as resultant series label.

length: int[source]#

Number of rows to create.