Skip to content

DOC: Fix EX01 in pandas.DataFrame.idxmax #32551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 11, 2020

Conversation

farhanreynaldo
Copy link
Contributor

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

Related to #27977.

################################################################################
################################## Validation ##################################
################################################################################

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @farhanreynaldo , just suggesting some very minor changes

Wheat Products 103.11 19.66
Beef 55.48 1712.00

By default, it returns index for the maximum value in each columns.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

co2_emission Beef
dtype: object

To return index for the maximum value in each rows, use ``axis="columns"``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


Examples
--------
Consider dataset containing food consumption in Argentina.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    Consider a dataset containing food consumption in Argentina.

Consider dataset containing food consumption in Argentina.

>>> df = pd.DataFrame({'consumption': [10.51, 103.11, 55.48],
... 'co2_emission': [37.2, 19.66, 1712]},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    ...                    'co2_emissions': [37.2, 19.66, 1712]},

(this will have to change in the other parts too)

@WillAyd WillAyd added the Docs label Mar 10, 2020
@farhanreynaldo
Copy link
Contributor Author

Thanks for the input, @MarcoGorelli!

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @farhanreynaldo, nice example.

@WillAyd WillAyd added this to the 1.1 milestone Mar 11, 2020
@WillAyd WillAyd merged commit ff6c8a0 into pandas-dev:master Mar 11, 2020
@WillAyd
Copy link
Member

WillAyd commented Mar 11, 2020

Thanks @farhanreynaldo

SeeminSyed pushed a commit to CSCD01-team01/pandas that referenced this pull request Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants