Orders placed in one month

Data framesMedium10 min

Your task

Given orders with columns order_id, customer, amount, status and placed, where placed is an ISO date string, return the orders placed in the given year and month. Return order_id and placed, sorted by order_id ascending.

Examples

orders_in_month(orders: dataframe, year: int, month: int) -> dataframe
Example 1
Inputorders_in_month(orders, 2024, 2)
orders
order_idcustomeramountstatusplaced
1ada120.5paid2024-01-05
2bo80refunded2024-01-07
3ada45.25paid2024-02-11
4cy200paid2024-02-14
5bo15.75pending2024-03-02
6ada60paid2024-03-19
Output
order_idplaced
32024-02-11
42024-02-14