A shop wants to feed T-shirt orders to a model, so the size column needs one-hot encoding. The sizes were typed by hand, so "Large", " large" and "LARGE" all appear, and some orders have no size at all (None).
Write encode_sizes(sizes), where sizes is a list with one entry per order.
pd.get_dummies, using 1 and 0 for the flags. Name the column size before encoding, so the new columns are called things like size_large.Return a dictionary with two keys:
"columns": the list of new column names, in the order get_dummies gives them"rows": a list with one list of 1s and 0s per order, in the input orderAt least one order has a size.