I have a dataset of sales data over the last year.
For each unique item in the product category I'd like to calculate the number of days between the first solDate and the last solDate.
The data contains two columns relevant to this 'solDate' which is a datetime object NS product which is a string. Each row in the data set an individual sale of the item.
My first instinct was to use a for loop to iterate through, check each column and then uncheck it when the next entry is found to figure out the last time sold but I know their must be an easier way + the dataset is 100,000 entries so I need something semi-efficent to complete in a reasonable time.
Im using pandas package for the analysis.