(Which set of items are mostly bought together) at I thought of an alternate solutionbought_together = all_data.groupby(by='Order ID').count() # Because this will count the number of times each order has been boughtmax_order = bought_together['Product'].idxmax() # Gives the order ID of the product which was bought most frequently (The count after groupby is the maximum)most_bought_together = all_data[all_data['Order ID'] == max_order]['Product'] # Gives the product name where Order ID is same as the max_order(01:02:21 - 01:26:07)
Solving real world data science tasks with Python Pandas!
Keith Galli
※本サイトに掲載されているチャンネル情報や動画情報はYouTube公式のAPIを使って取得・表示しています。
Timetable
動画タイムテーブル
動画数:88件