# dask.dataframe.DataFrame.idxmax

#### DataFrame.idxmax(axis=0, skipna=True, numeric_only=False, split_every=False)

Return index of first occurrence of maximum over requested axis.

This docstring was copied from pandas.DataFrame.idxmax.

Some inconsistencies with the Dask version may exist.

NA/null values are excluded.

* **Parameters:**
  **axis**
  : The axis to use. 0 or ‘index’ for row-wise, 1 or ‘columns’ for column-wise.

  **skipna**
  : Exclude NA/null values. If the entire DataFrame is NA,
    or if `skipna=False` and there is an NA value, this method
    will raise a `ValueError`.

  **numeric_only**
  : Include only float, int or boolean data.
* **Returns:**
  Series
  : Indexes of maxima along the specified axis.
* **Raises:**
  ValueError
  : * If the row/column is empty

#### SEE ALSO
[`Series.idxmax`](dask.dataframe.Series.idxmax.html.md#dask.dataframe.Series.idxmax)
: Return index of the maximum element.

### Notes

This method is the DataFrame version of `ndarray.argmax`.

### Examples

Consider a dataset containing food consumption in Argentina.

```pycon
>>> df = pd.DataFrame(
...     {
...         "consumption": [10.51, 103.11, 55.48],
...         "co2_emissions": [37.2, 19.66, 1712],
...     },
...     index=["Pork", "Wheat Products", "Beef"],
... )
```

```pycon
>>> df
                consumption  co2_emissions
Pork                  10.51         37.20
Wheat Products       103.11         19.66
Beef                  55.48       1712.00
```

By default, it returns the index for the maximum value in each column.

```pycon
>>> df.idxmax()
consumption      Wheat Products
co2_emissions              Beef
dtype: str
```

To return the index for the maximum value in each row, use `axis="columns"`.

```pycon
>>> df.idxmax(axis="columns")
Pork              co2_emissions
Wheat Products     consumption
Beef              co2_emissions
dtype: str
```

<!-- !! processed by numpydoc !! -->
