Pretty one-liner 🙂
new_df = df.idxmax(axis=1)
More Related Contents:
- How to drop rows of Pandas DataFrame whose value in a certain column is NaN
- How to make separator in pandas read_csv more flexible wrt whitespace, for irregular separators?
- Why isn’t my Pandas ‘apply’ function referencing multiple columns working? [closed]
- Convert the string 2.90K to 2900 or 5.2M to 5200000 in pandas dataframe
- Conditionally fill column values based on another columns value in pandas
- Drop rows containing empty cells from a pandas DataFrame
- How to form tuple column from two columns in Pandas
- pandas concat generates nan values
- Remove duplicate rows from Pandas dataframe where only some columns have the same value
- Normalize columns of a dataframe
- Pandas selecting by label sometimes return Series, sometimes returns DataFrame
- How to switch columns rows in a pandas dataframe
- Pandas Groupby and Sum Only One Column
- Quickest way to make a get_dummies type dataframe from a column with a multiple of strings
- Pandas groupby.size vs series.value_counts vs collections.Counter with multiple series
- “unstack” a pandas column containing lists into multiple rows [duplicate]
- How to check whether a pandas DataFrame is empty?
- Python pandas Filtering out nan from a data selection of a column of strings
- Remove name, dtype from pandas output of dataframe or series
- Copy pandas dataframe to excel using openpyxl
- How to drop unique rows in a pandas dataframe?
- pandas – find first occurrence
- How to convert a dataframe to a dictionary
- How can I replicate rows of a Pandas DataFrame?
- How to get/set a pandas index column title or name?
- Pandas: drop columns with all NaN’s
- In Python pandas, start row index from 1 instead of zero without creating additional column
- Convert pandas DataFrame into list of lists [duplicate]
- Get max value from row of a dataframe in python [duplicate]
- When is it appropriate to use df.value_counts() vs df.groupby(‘…’).count()?