Hot answers tagged

1

You can access the steps within a pipeline by their name using the named_steps attributes. After getting the preprocessing step you can then use the transformers_ attribute in combination with standard python indexing to get to the OrdinalEncoder. Using the categories_ attributes then gives you the attributes for the encoder and, since the index of each ...


1

This is more of a programming question than a data science question and would therefore be better suited for stackoverflow stackexchange, but the following code should do what you're looking for: df[["A", "C"]] = ( df # create groups .groupby(["B", "D"]) # transform the groups by filling na values with ...


Only top voted, non community-wiki answers of a minimum length are eligible