Use argmax()
idxmax()
to get the index of the max value. Then you can use loc
df.loc[df['favcount'].idxmax(), 'sn']
Edit: argmax()
is now deprecated, switching for idxmax()
More Related Contents:
- Get the row(s) which have the max value in groups using groupby
- How are iloc and loc different?
- Find the column name which has the maximum value for each row
- pandas loc vs. iloc vs. at vs. iat?
- How to reset index in a pandas dataframe? [duplicate]
- What rules does Pandas use to generate a view vs a copy?
- How to avoid Python/Pandas creating an index in a saved csv?
- What is the difference between using squared brackets or dot to access a column?
- how do I insert a column at a specific column index in pandas?
- How to find all positions of the maximum value in a list?
- What is the performance impact of non-unique indexes in pandas?
- Python Pandas: Get index of rows which column matches certain value
- Remove index name in pandas
- Accessing Pandas column using squared brackets vs using a dot (like an attribute)
- What is the point of indexing in pandas?
- Find maximum value of a column and return the corresponding row values using Pandas
- Python pandas slice dataframe by multiple index ranges
- How to query MultiIndex index columns values in pandas
- Pandas – Compute z-score for all columns
- How to apply NLTK word_tokenize library on a Pandas dataframe for Twitter data?
- Set maximum value (upper bound) in pandas DataFrame
- How to avoid pandas creating an index in a saved csv
- Get first row value of a given column
- Using replace efficiently in pandas
- In Python pandas, start row index from 1 instead of zero without creating additional column
- Python Pandas add column for row-wise max value of selected columns [duplicate]
- Selecting a range of columns in a dataframe
- How to efficiently assign unique ID to individuals with multiple entries based on name in very large df
- start index at 1 for Pandas DataFrame
- Get max value from row of a dataframe in python [duplicate]