Skip to content

Add test case for applying a function to a groupby object that append… #53138

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

Merged
merged 12 commits into from
May 9, 2023

Conversation

idor980
Copy link
Contributor

@idor980 idor980 commented May 8, 2023

…s each group to a list without using copy() function. The test checks if the groups are correctly appended to the list. This resolves GH issue 17718.

…s each group to a list without using copy() function. The test checks if the groups are correctly appended to the list. This resolves GH issue 17718.
Copy link
Contributor

@srkds srkds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
Some checks are failing because of the formatting of the code.
here is the documentation for pre-commit.
Could you install it and then commit again?

@idor980
Copy link
Contributor Author

idor980 commented May 8, 2023

Hi,
Some checks are failing because of the formatting of the code.
here is the documentation for pre-commit.
Could you install it and then commit again?

OK, thank you :)

groups.append(group)

df.groupby("index").apply(store)
expected_value = DataFrame(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make expected equal to

DataFrame({"index": [0] * 10, 0: [1] * 10}, index=np.arange(0, 100, 10))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make expected equal to

DataFrame({"index": [0] * 10, 0: [1] * 10}, index=np.arange(0, 100, 10))

No Problem ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make expected equal to

DataFrame({"index": [0] * 10, 0: [1] * 10}, index=np.arange(0, 100, 10))

Is it ok that I used pd.RangeIndex instead of np.arange? I got an error about dtypes and pd.RangeIndex fixed it

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label May 8, 2023
@mroeschke mroeschke added this to the 2.1 milestone May 9, 2023
@mroeschke mroeschke merged commit 09d79ac into pandas-dev:main May 9, 2023
@mroeschke
Copy link
Member

Thanks @idor980

@idor980 idor980 deleted the my-first-branch branch May 9, 2023 16:55
Rylie-W pushed a commit to Rylie-W/pandas that referenced this pull request May 19, 2023
pandas-dev#53138)

* Add test case for applying a function to a groupby object that appends each group to a list without using copy() function. The test checks if the groups are correctly appended to the list. This resolves GH issue 17718.

* installed pre-commit

* update expected_value

* update expected and installed pre-commit

* test commit

* committing update for expected value from my last verified commit

* update expected_value to  pd.DataFrame({index: [0] * 10, 0: [1] * 10}, index=pd.RangeIndex(0, 100, step=10))

---------

Co-authored-by: Ido Ronen <idor98@Idos-MacBook-Pro.local>
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
pandas-dev#53138)

* Add test case for applying a function to a groupby object that appends each group to a list without using copy() function. The test checks if the groups are correctly appended to the list. This resolves GH issue 17718.

* installed pre-commit

* update expected_value

* update expected and installed pre-commit

* test commit

* committing update for expected value from my last verified commit

* update expected_value to  pd.DataFrame({index: [0] * 10, 0: [1] * 10}, index=pd.RangeIndex(0, 100, step=10))

---------

Co-authored-by: Ido Ronen <idor98@Idos-MacBook-Pro.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Groupy chunks are garbage-collected even if still referenced
3 participants