To get the highest values of a column, you can use nlargest() :
df['High'].nlargest(2)
The above will give you the 2 highest values of column High
.
You can also use nsmallest() to get the lowest values.
More Related Contents:
- Pandas conditional creation of a series/dataframe column
- Split (explode) pandas dataframe string entry to separate rows
- Binning a column with Python Pandas
- Performant cartesian product (CROSS JOIN) with pandas
- Pandas read_csv low_memory and dtype options
- How to take column-slices of dataframe in pandas
- replace() method not working on Pandas DataFrame
- Numpy “where” with multiple conditions
- How to map numeric data into categories / bins in Pandas dataframe
- Coalesce values from 2 columns into a single column in a pandas dataframe
- Conditionally fill column values based on another columns value in pandas
- How can I map True/False to 1/0 in a Pandas DataFrame?
- How to check if a value is in the list in selection from pandas data frame?
- Pandas finding local max and min
- SQL-like window functions in PANDAS: Row Numbering in Python Pandas Dataframe
- Pandas lookup from one of multiple columns, based on value
- Ambiguity in Pandas Dataframe / Numpy Array “axis” definition
- ‘DataFrame’ object has no attribute ‘sort’
- python pandas flatten a dataframe to a list
- how do I calculate a rolling idxmax
- What is dtype(‘O’), in pandas?
- vectorize conditional assignment in pandas dataframe
- Why is np.where faster than pd.apply
- How can I count the number of consecutive TRUEs in a DataFrame?
- Binning a column with pandas
- Unpivot Pandas Data
- Store numpy.array in cells of a Pandas.DataFrame
- Python pandas: how to remove nan and -inf values
- Filtering pandas dataframe with multiple Boolean columns
- What’s the best way to sum all values in a Pandas dataframe? [duplicate]