I have the following code with some aggregation function:
new_df = my_df.groupBy('id').agg({"id": "count", "money":"max"})
Then the new column I have are COUNT(id)
and MAX(money)
. Can I specify the column names myself instead of using the default one? E.g. I want them to be called my_count_id
and my_max_money
. How do I do that? Thanks!