This is bakery dataset which was discussed in class
bakery=pd.read_csv('https://raw.githubusercontent.com/02asmita/Term-4/patch-1/Data/Assignment/BreadBasket_DMS.csv')
hot_encoded_bakery=bakery.groupby(['Transaction','Item'])['Item'].count().unstack().reset_index().fillna(0).set_index('Transaction')
hot_encoded_bakery.head(10)
What does above line of code does ??
Solution:
After performing the above operation, the values are in the form of float. You may need to convert the values to int type as well if required.
Comments
0 comments
Article is closed for comments.