-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Backport PR #27827 on branch 0.25.x (BUG: Fixed groupby quantile for listlike q) #28085
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
TomAugspurger
merged 1 commit into
pandas-dev:0.25.x
from
meeseeksmachine:auto-backport-of-pr-27827-on-0.25.x
Aug 22, 2019
Merged
Backport PR #27827 on branch 0.25.x (BUG: Fixed groupby quantile for listlike q) #28085
TomAugspurger
merged 1 commit into
pandas-dev:0.25.x
from
meeseeksmachine:auto-backport-of-pr-27827-on-0.25.x
Aug 22, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just codecov. The merge build should pass. |
@TomAugspurger I just tested this on Pandas 0.25.1 pip build Windows x64 Python 3.7.1 df = pd.DataFrame(np.random.randint(0,5, size=(10,3)), columns=list('ABC'))
df.groupby('A').quantile([.3,.7])
|
That's unfortunate. Can you open a new issue with that example?
…On Thu, Aug 22, 2019 at 3:35 PM Gagi ***@***.***> wrote:
@TomAugspurger <https://github.com/TomAugspurger> I just tested this on
Pandas 0.25.1 pip build Windows x64 Python 3.7.1
df = pd.DataFrame(np.random.randint(0,5, size=(10,3)), columns=list('ABC'))
df.groupby('A').quantile([.3,.7])
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-16-f3668ef567ee> in <module>
----> 1 df3.groupby('A').quantile([.3,.7])
c:\python37\lib\site-packages\pandas\core\groupby\groupby.py in quantile(self, q, interpolation)
1951 indices = np.concatenate(arrays)
1952 assert len(indices) == len(result)
-> 1953 return result.take(indices)
1954
1955 @substitution(name="groupby")
c:\python37\lib\site-packages\pandas\core\generic.py in take(self, indices, axis, is_copy, **kwargs)
3602
3603 new_data = self._data.take(
-> 3604 indices, axis=self._get_block_manager_axis(axis), verify=True
3605 )
3606 result = self._constructor(new_data).__finalize__(self)
c:\python37\lib\site-packages\pandas\core\internals\managers.py in take(self, indexer, axis, verify, convert)
1387 n = self.shape[axis]
1388 if convert:
-> 1389 indexer = maybe_convert_indices(indexer, n)
1390
1391 if verify:
c:\python37\lib\site-packages\pandas\core\indexers.py in maybe_convert_indices(indices, n)
199 mask = (indices >= n) | (indices < 0)
200 if mask.any():
--> 201 raise IndexError("indices are out-of-bounds")
202 return indices
203
IndexError: indices are out-of-bounds
```
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#28085?email_source=notifications&email_token=AAKAOISRDWE5GGABDXHRDB3QF32ANA5CNFSM4IOT44DKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD46KBDY#issuecomment-524066959>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKAOIT647ECNE2FSYQ4CNDQF32ANANCNFSM4IOT44DA>
.
|
nvm, I think I have a fix.
On Fri, Aug 23, 2019 at 8:28 AM Tom Augspurger <[email protected]>
wrote:
… That's unfortunate. Can you open a new issue with that example?
On Thu, Aug 22, 2019 at 3:35 PM Gagi ***@***.***> wrote:
> @TomAugspurger <https://github.com/TomAugspurger> I just tested this on
> Pandas 0.25.1 pip build Windows x64 Python 3.7.1
>
> df = pd.DataFrame(np.random.randint(0,5, size=(10,3)), columns=list('ABC'))
> df.groupby('A').quantile([.3,.7])
>
> ---------------------------------------------------------------------------
> IndexError Traceback (most recent call last)
> <ipython-input-16-f3668ef567ee> in <module>
> ----> 1 df3.groupby('A').quantile([.3,.7])
>
> c:\python37\lib\site-packages\pandas\core\groupby\groupby.py in quantile(self, q, interpolation)
> 1951 indices = np.concatenate(arrays)
> 1952 assert len(indices) == len(result)
> -> 1953 return result.take(indices)
> 1954
> 1955 @substitution(name="groupby")
>
> c:\python37\lib\site-packages\pandas\core\generic.py in take(self, indices, axis, is_copy, **kwargs)
> 3602
> 3603 new_data = self._data.take(
> -> 3604 indices, axis=self._get_block_manager_axis(axis), verify=True
> 3605 )
> 3606 result = self._constructor(new_data).__finalize__(self)
>
> c:\python37\lib\site-packages\pandas\core\internals\managers.py in take(self, indexer, axis, verify, convert)
> 1387 n = self.shape[axis]
> 1388 if convert:
> -> 1389 indexer = maybe_convert_indices(indexer, n)
> 1390
> 1391 if verify:
>
> c:\python37\lib\site-packages\pandas\core\indexers.py in maybe_convert_indices(indices, n)
> 199 mask = (indices >= n) | (indices < 0)
> 200 if mask.any():
> --> 201 raise IndexError("indices are out-of-bounds")
> 202 return indices
> 203
>
> IndexError: indices are out-of-bounds
> ```
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#28085?email_source=notifications&email_token=AAKAOISRDWE5GGABDXHRDB3QF32ANA5CNFSM4IOT44DKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD46KBDY#issuecomment-524066959>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAKAOIT647ECNE2FSYQ4CNDQF32ANANCNFSM4IOT44DA>
> .
>
|
TomAugspurger
added a commit
to TomAugspurger/pandas
that referenced
this pull request
Aug 23, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport PR #27827: BUG: Fixed groupby quantile for listlike q