Python 熊猫数据帧-最近注册的客户每注册一天的订单计数

Python 熊猫数据帧-最近注册的客户每注册一天的订单计数,python,pandas,dataframe,Python,Pandas,Dataframe,我有一个表Clients['client_uuid','registered_at'](['some_uuid','2020-01-01'])。 和一个订单表['order\u created\u at','client\u uuid']。 我需要像这样汇总这些数据: Column 1: Day (date) Column 2: The number of clients, that registered that day, who have at least one order that da

我有一个表Clients
['client_uuid','registered_at']
(['some_uuid','2020-01-01'])。 和一个订单
['order\u created\u at','client\u uuid']
。 我需要像这样汇总这些数据:

Column 1: Day (date)
Column 2: The number of clients, that registered that day, who have at least one order that day
Column 2: The number of orders made by clients who registered that day
Column 3: The numbers of all clients, who have at least one order that day
Column 3: The number of total orders by all clients in that day
可能有一个使用循环等的解决方案,但我希望有一个更漂亮的解决方案,可能有一个groupby,agg函数。但我没有主意

例如: 订单表

order_created_at | client_uuid
2020-01-01       | client1
2020-01-01       | client2
2020-01-01       | client2
2020-01-01       | client4
2020-01-02       | client2
2020-01-02       | client3
客户表

registered_at    | client_uuid
2020-01-01       | client1
2020-01-01       | client2
2020-01-02       | client3
输出表

[date, new_clients_first_orders, new_clients_total_orders, total_clients, total_orders]
[2020-01-01, 2, 3, 3, 4]
[2020-01-02, 1, 1, 2, 2]
尝试:

输出:

            total_count  total_nunique  new_total_count  new_total_nunique
2020-01-01            4              3                2                  2
2020-01-02            2              2                1                  1

使用
合并
的一些东西。但是,您应该包括特定的示例数据和预期的输出。完成。我想知道每天有多少注册客户至少下了一个订单,以及他们当天总共下了多少订单。如果今天有5个客户的10个订单,而这10个订单中的4个订单是由今天注册的2个客户完成的,那么输出看起来像[今天,2,4,5,10]
            total_count  total_nunique  new_total_count  new_total_nunique
2020-01-01            4              3                2                  2
2020-01-02            2              2                1                  1