Skip to content

DOC: Broken import in snippet (pandas.testing.assert_frame_equal) #43778

Closed
@BryanRacic

Description

@BryanRacic

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

Location of the documentation

I have checked that the issue still exists on the latest versions of the docs on master: https://pandas.pydata.org/docs/dev/reference/api/pandas.testing.assert_frame_equal.html

"pandas.testing.assert_frame_equal"

Documentation problem

Example snippet for assert_frame_equal has a leading underscore in the import statement (for testing). I think this is unnecessary and breaks execution when attempted by a user.

from pandas._testing import assert_frame_equal
df1 = pd.DataFrame({'a': [1, 2], 'b': [3, 4]})
df2 = pd.DataFrame({'a': [1, 2], 'b': [3.0, 4.0]})

Suggested fix for documentation

Remove the underscore in question:

from pandas.testing import assert_frame_equal
df1 = pd.DataFrame({'a': [1, 2], 'b': [3, 4]})
df2 = pd.DataFrame({'a': [1, 2], 'b': [3.0, 4.0]})

This should fix execution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions