First, Lets create a dummy dataframe
We assume that a customer can have n orders, an order can have m items, and items can be ordered more multiple times
orders_df = pd.DataFrame()
orders_df['customer_id'] = [1,1,1,1,1,2,2,3,3,3,3,3]
orders_df['order_id'] = [1,1,1,2,2,3,3,4,5,6,6,6]
orders_df['...