I am currently working on a dataset that has two columns: customerID and date.
I want to find the minimum date for each customerID.
Initially, I used the following code:
dataframe['min_date'] = dataframe.groubpy('customerID')['date'].min()
However, this returned null values.
Then, I used this code instead:
dataframe['min_date'] = dataframe.groubpy('customerID')['date'].transform('min')
This returned the correct values.
I would like to understand the difference between these two operations.