In the UniformEncoder, replacing NaN raises the following FutureWarning sometimes:
FutureWarning: The behavior of Series.replace (and DataFrame.replace) with CategoricalDtype is deprecated.
In a future version, replace will only be used for cases that preserve the categories.
To change the categories, use ser.cat.rename_categories instead.
Environment Details
Error Description
In the
UniformEncoder
, replacing NaN raises the followingFutureWarning
sometimes:It gets raised here: https://github.com/sdv-dev/RDT/blob/ecf749959276dacd54efc474edfdc5f7804e133e/rdt/transformers/categorical.py#L200
A fix here would be to use
ser.cat.remove_categories()
Step to reproduce