Skip to content
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

Pandas 1.3.5 Shallow Copy Discrepancy #9

Closed
michaelmckinsey1 opened this issue Apr 24, 2023 · 1 comment
Closed

Pandas 1.3.5 Shallow Copy Discrepancy #9

michaelmckinsey1 opened this issue Apr 24, 2023 · 1 comment

Comments

@michaelmckinsey1
Copy link
Collaborator

michaelmckinsey1 commented Apr 24, 2023

Problem

When running the unit test test_copy:test_copy() on GitHub for python3.7 and pandas==1.3.5 the following error will occur

        # Shallow copy of data
        node = other.dataframe.index.get_level_values("node")[0]
        profile = other.dataframe.index.get_level_values("profile")[0]
        other.dataframe.loc[(node, profile), "nid"] = -1
>       assert (
            other.dataframe.loc[(node, profile), "nid"]
            == self.dataframe.loc[(node, profile), "nid"]
        )
E       assert -1.0 == 26.0

This error does not happen when running locally, tested with python3.7.2 and pandas==1.3.5.

Current Fix

Our current fix was to change the pandas version on GitHub to pandas==1.2.5 and the error does not occur. For reference the error does not occur for pandas==1.4 and pandas==2.0, so our suspicion is the error only occurs for pandas==1.3.5.

This is somewhat known by pandas and they fixed the inconsistency in pandas==1.5. See:

@michaelmckinsey1
Copy link
Collaborator Author

Resolved by depreciating Python 3.7 (#107)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant