Skip to content

Make explicit in pandas docs the imports and the options #149

Open
@datapythonista

Description

@datapythonista

See pandas-dev/pandas#28038

Until now, there has been a hidden code block at the beginning of every documentation page with imports, random seeds and options. There is agreement to make that code explicit, so the users can reproduce exactly the code, and there is no "magic" going on.

Let's start by opening a PR to remove that header in this page: https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html

My preferred option is to remove the {{ header }} variable, keep the currentmodule in its place, but not the code block. Then, just add what it's needed in the code blocks when things are first used. For example, in the first block code add import pandas as pd at the beginning. We probably only need the code with the random seed in the block with the first use of numpy.random.

After the change it can be good to run a diff of the html version before the change, and after the change, and see how much did it change (and add that diff to the PR description).

Note that several people in the pandas team is likely to have opinions on how this change should be implemented. So be prepared for several reviews, and several iterations of proposed changes and questions. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions