df2onehot is a Python package to convert unstructured DataFrames into structured dataframes, such as one-hot dense arrays.
⭐️ Star this repo if you like it ⭐️
pip install df2onehotfrom df2onehot import df2onehotOn the documentation pages you can find detailed information about the working of the df2onehot with many examples.
results = df2onehot(df)# Force features (int or float) to be numeric if unique non-zero values are above percentage.
out = df2onehot(df, perc_min_num=0.8)# Remove categorical features for which less then 2 values exists.
out = df2onehot(df, y_min=2)# Combine two rules above.
out = df2onehot(df, y_min=2, perc_min_num=0.8)