'How to find minimum of some variable with repeating row indexes and preserve all other variables in Python Pandas
Basically, I have multiple repeating dates and the indices (1/2/1990 many times followed by 1/3/1990 many more times, etc.)
I want to find the minimum of a given variable, open_less_strike on a given day. I want a dataframe to return with that corresponding row of the minimum value.
I have been trying the line below, but it only returns a series with the minimums. I need to retrieve the rest of the variables for that row as well.
df_min = df.groupby([df.index])['open_less_strike'].min()

Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
