Skip to content

BUG: unnecessary repetition of variable in explode test #34934

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
3 tasks done
erfannariman opened this issue Jun 22, 2020 · 1 comment · Fixed by #34949
Closed
3 tasks done

BUG: unnecessary repetition of variable in explode test #34934

erfannariman opened this issue Jun 22, 2020 · 1 comment · Fixed by #34949
Assignees
Labels
Milestone

Comments

@erfannariman
Copy link
Member

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


In the test test_typical_usecase in series/methods/test_explode.py there's

def test_typical_usecase():

    df = pd.DataFrame(
        [{"var1": "a,b,c", "var2": 1}, {"var1": "d,e,f", "var2": 2}],
        columns=["var1", "var2"],
    )
    exploded = df.var1.str.split(",").explode()
    exploded
    result = df[["var2"]].join(exploded)
    expected = pd.DataFrame(
        {"var2": [1, 1, 1, 2, 2, 2], "var1": list("abcdef")},
        columns=["var2", "var1"],
        index=[0, 0, 0, 1, 1, 1],
    )
    tm.assert_frame_equal(result, expected)

Problem description

The variable exploded is called unnecessary.

@erfannariman erfannariman added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 22, 2020
@erfannariman
Copy link
Member Author

take

@simonjayhawkins simonjayhawkins added Clean and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 23, 2020
@simonjayhawkins simonjayhawkins added this to the 1.1 milestone Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants