which_bin np digitize(xbins=binsprint("\ndata points:\ " [: ]print("\nbin membership for data points:\ "which_bin[: ]out[ ]data points[[- [- ]bin membership for data points[ [ ]what we did here is transform the single continuous input feature in the wave dataset into categorical feature that encodes which bin data point is in to use scikitlearn model on this datawe transform this discrete feature to one-hot encoding using the onehotencoder from the preprocessing module the onehotencoder does the same encoding as pandas get_dummiesthough it currently only works on categorical variables that are integersin[ ]from sklearn preprocessing import onehotencoder transform using the onehotencoder encoder onehotencoder(sparse=falseencoder fit finds the unique values that appear in which_bin encoder fit(which_bintransform creates the one-hot encoding x_binned encoder transform(which_binprint(x_binned[: ]out[ ][ ]because we specified binsthe transformed dataset x_binned now is made up of features representing data and engineering features