Skip to content

DOC: The argument of pandas.DataFrame.to_markdown is unfriendly #34568

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

Closed
nuka137 opened this issue Jun 4, 2020 · 5 comments · Fixed by #34594
Closed

DOC: The argument of pandas.DataFrame.to_markdown is unfriendly #34568

nuka137 opened this issue Jun 4, 2020 · 5 comments · Fixed by #34594
Labels
API Design Docs IO Data IO issues that don't fit into a more specific label Needs Discussion Requires discussion from core team before further action

Comments

@nuka137
Copy link
Contributor

nuka137 commented Jun 4, 2020

Location of the documentation

https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.to_markdown.html

Documentation problem

The document of pandas.DataFrame.to_markdown is unfriendly because many options are shown as **kwargs.
I think these arguments should be documented explicitly like a to_csv.

https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.to_csv.html

Suggested fix for documentation

All arguments supported by to_markdown should be shown at document.
If don't mind, I would like to tackle this improvement.

@nuka137 nuka137 added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 4, 2020
@MarcoGorelli
Copy link
Member

Thanks @nuka137 - there's a PR open to document 'index', if you'd like to document other options I think that would be welcome

@TomAugspurger
Copy link
Contributor

I'd caution against adding too many keyword arguments. The function could be expanded in the future to accept an engine function to determine which package we use to format things.

So we should only add explicit keywords for names that are standard across the rest of pandas IO methods.

@TomAugspurger TomAugspurger added API Design IO Data IO issues that don't fit into a more specific label Needs Discussion Requires discussion from core team before further action and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 4, 2020
@nuka137
Copy link
Contributor Author

nuka137 commented Jun 4, 2020

@MarcoGorelli @TomAugspurger

Thanks!
I agree not to introduce many keywords too. But I didn't intend to add more keyword arguments in this issue.
This issue mentions the unclear documentation of **kwargs.

I think adding a link of tabulate package to this document is enough for the user.
Or, it may be good to add an example which uses tabulate argument.
The users can check what options they need to pass to **kwargs.
What do you think of this idea?

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Jun 4, 2020 via email

@nuka137
Copy link
Contributor Author

nuka137 commented Jun 6, 2020

I noticed pandas.Series.to_markdown has same argument.
So, I also created PR for it (#34616 ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Docs IO Data IO issues that don't fit into a more specific label Needs Discussion Requires discussion from core team before further action
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants