Pandas get second minimum value from datetime column [duplicate]
问题 This question already has answers here : How to extract the n-th maximum/minimum value in a column of a DataFrame in pandas? (2 answers) Closed 1 year ago . I have a data frame with a DateTime column, I can get minimum value by using df['Date'].min() How can I get the second, third... smallest values 回答1: Use nlargest or nsmallest For second largest, series.nlargest(2).iloc[-1] 回答2: Make sure your dates are in datetime first: df['Sampled_Date'] = pd.to_datetime(df['Sampled_Date']) Then drop