Skip to content

DOC: Strange examples order in DataFrame.to_csv #56256

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
1 task done
JB-AM opened this issue Nov 30, 2023 · 1 comment · Fixed by #56342
Closed
1 task done

DOC: Strange examples order in DataFrame.to_csv #56256

JB-AM opened this issue Nov 30, 2023 · 1 comment · Fixed by #56342
Labels
Docs Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@JB-AM
Copy link

JB-AM commented Nov 30, 2023

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

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

Documentation problem

Not really a blocking issue, but when reading the doc, I was rather surprised that the first example, instead of simply exporting a df to a csv file, implicated some rather more complicated zip encryption.
A first simple/dummy example would have helped me there, before getting to finer arcanes.

Suggested fix for documentation

Insert a first simple example of exporting a dataframe to a simple csv file.

@JB-AM JB-AM added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Nov 30, 2023
@linus-md
Copy link
Contributor

linus-md commented Dec 5, 2023

Maybe adding a first example like this would be useful.

        --------
        Saving a `df` to `.csv`.
        >>> df = pd.DataFrame({{'name': ['Raphael', 'Donatello'],
        ...                    'mask': ['red', 'purple'],
        ...                    'weapon': ['sai', 'bo staff']}})
        >>> df.to_csv('out.csv', index=False)

I could create a PR if requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants