[
https://issues.apache.org/jira/browse/BEAM-12138?focusedWorklogId=582059&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-582059
]
ASF GitHub Bot logged work on BEAM-12138:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 13/Apr/21 20:48
Start Date: 13/Apr/21 20:48
Worklog Time Spent: 10m
Work Description: TheNeuralBit commented on a change in pull request
#14487:
URL: https://github.com/apache/beam/pull/14487#discussion_r612765867
##########
File path: sdks/python/apache_beam/dataframe/frames_test.py
##########
@@ -640,6 +646,26 @@ def change_index_names(df):
self._run_test(change_index_names, df)
+ @parameterized.expand((x, ) for x in [
+ 0,
+ [1],
+ 3,
+ [0, 3],
+ [2, 1],
+ ['foo', 0],
+ [1, 'str'],
+ [3, 0, 2, 1],
+ ])
+ def test_groupby_level_agg(self, level):
Review comment:
This does use a MultiIndex, the `set_index` call below copies several
columns into a MultiIndex:
```py
In [1]: from apache_beam.dataframe.frames_test import GROUPBY_DF
In [2]: GROUPBY_DF.set_index(['group', 'foo', 'bar', 'str'], drop=False)
Out[2]:
group foo bar baz bool str
group foo bar str
a NaN NaN 0 a NaN NaN NaN True 0
b 1.0 98.0 1 b 1.0 98.0 2.0 False 1
2.0 97.0 2 b 2.0 97.0 4.0 False 2
a 3.0 96.0 3 a 3.0 96.0 6.0 False 3
b 4.0 95.0 4 b 4.0 95.0 8.0 False 4
... ... ... ... ... ... ..
a 95.0 4.0 95 a 95.0 4.0 190.0 False 95
96.0 3.0 96 a 96.0 3.0 192.0 False 96
b 97.0 2.0 97 b 97.0 2.0 194.0 False 97
98.0 NaN 98 b 98.0 NaN 196.0 False 98
a NaN 0.0 99 a NaN 0.0 198.0 False 99
[100 rows x 6 columns]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 582059)
Time Spent: 1h 20m (was: 1h 10m)
> DataFrame API: groupby(level=) only works for level=0
> -----------------------------------------------------
>
> Key: BEAM-12138
> URL: https://issues.apache.org/jira/browse/BEAM-12138
> Project: Beam
> Issue Type: Bug
> Components: sdk-py-core
> Reporter: Brian Hulette
> Assignee: Brian Hulette
> Priority: P2
> Labels: dataframe-api
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)