Paid and total orders per customer

Data framesHard12 min

Your task

Given orders with columns order_id, customer, amount, status and placed, return per customer the count of paid orders as paid and the count of all their orders as total. Every customer appears, even with zero paid. Sort by customer ascending.

Examples

order_mix(orders: dataframe) -> dataframe
Example 1
Inputorder_mix(orders)
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
customerpaidtotal
ada33
bo02
cy11