Skip to content

Latest commit

 

History

History
11 lines (10 loc) · 419 Bytes

586. Customer Placing the Largest Number of Orders.md

File metadata and controls

11 lines (10 loc) · 419 Bytes

586. Customer Placing the Largest Number of Orders

Question Link

Soluton

import pandas as pd

def largest_orders(orders: pd.DataFrame) -> pd.DataFrame:
    a=orders.groupby(['customer_number'])['order_number'].nunique().reset_index()
    a=a[a['order_number']==a['order_number'].max()]
    return a[['customer_number']]