Skip to content

DOC: Add docstring for DataFrame.T property #50766

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 2 commits into from
Jan 16, 2023

Conversation

smij720
Copy link
Contributor

@smij720 smij720 commented Jan 16, 2023

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

Before this change:
The T property of a DataFrame is named in the docs but is not linked to any documentation:

(Screenshot below taken from https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.html)

image

After this change
The T property is linked to documentation (it now appears as the top property alphabetically, I guess because it's a capital 'T').

image

And if you click on it you see this new page. As you can see, it links through to the existing DataFrame.transpose docs. I put in one simple example here.
image

Comment on lines 3592 to 3593


Copy link
Contributor

Choose a reason for hiding this comment

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

There should be only one blank line here.

And it seems more appropriate that the order is Returns, See also, Examples.

Copy link
Contributor Author

@smij720 smij720 Jan 16, 2023

Choose a reason for hiding this comment

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

Thank you - agreed. I have made those changes.

(for anyone else reading this - the reordering edit in response to this feedback means that the doc sections in the code now match the order in which the docs are rendered, which makes more sense)

@mroeschke mroeschke added this to the 2.0 milestone Jan 16, 2023
@mroeschke mroeschke added the Docs label Jan 16, 2023
@mroeschke mroeschke merged commit 35586f3 into pandas-dev:main Jan 16, 2023
@mroeschke
Copy link
Member

Thanks @smij720

@smij720 smij720 deleted the docstring-for-dataframe-transpose branch November 27, 2023 00:21
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.

3 participants