IndexGenerator
Compatibility: id
data
The IndexGenerator
is used to create an indexed ID column that you may be using as a primary key. When transforming the data, it removes the column. When reversing the the transform, it creates an indexed ID column starting at a specified counter, with any additional prefixes or suffixes you provide.

from rdt.transformers.text import IndexGenerator
transformer = IndexGenerator(prefix='ID_', starting_value=0, suffix='-synthetic')
Parameters
prefix
: A string with the prefix to use for the counter. All generated IDs will have the prefix.
(default) None
Do not add a prefix
<string>
Add the prefix to every ID
starting_value
: The starting value for the counter
(default) 0
Start the counter at 0.
<integer>
Use the integer as the starting value. This must be >=0.
suffix
: A string with the suffix to use for the counter. All generated IDs will have the suffix.
(default) None
Do not add a suffix
<string>
Add the suffix to every ID
FAQs
Last updated