When I try to use the function below
top3 = df1.nlargest(3, 'perChange', keep='all')
Even if keep = 'all', the output is
92 3.828120
255 -0.673854
256 -0.673854
Name: perChange, dtype: float64
However, the sorted array is
92 3.828120
255 -0.673854
256 -0.673854
304 -1.906793
340 -2.643661
355 -3.421462
359 -3.549768
What I want is
92 3.828120
255 -0.673854
256 -0.673854
304 -1.906793
How can I solve the problem?
Edit: For the people who interest to solve it, here is the example code which show the problem.
# initialize data of lists.
data = {'value': [3.828120, -0.673854, -0.673854, -1.906793, -2.643661]}
# Create DataFrame
test_df = pd.DataFrame(data)
test_df = test_df.nlargest(3, 'value', keep='all')
# Print the output.
print(test_df['value'])