Pandas - get_dummies with value from another column
问题 I have a dataframe like below. The column Mfr Number is a categorical data type. I'd like to preform get_dummies or one hot encoding on it, but instead of filling in the new column with a 1 if it's from that row, I want it to fill in the value from the quantity column. All the other new 'dummies' should remain a 0 on that row. Is this possible? Datetime Mfr Number quantity 0 2016-03-15 07:02:00 MWS0460MB 1 1 2016-03-15 07:03:00 TM-120-6X 3 2 2016-03-15 08:33:00 40.50699.0095 5 3 2016-03-15 08