Groupby with more than two columns isn't possible
See original GitHub issueDescribe the bug I’m a little unsure if this is a bug? Or some sort of un-documented restriction?
If you try to groupby with 3 columns, it only groups by the first. If you try to groupby with 2 columns, it only groups by both.
Version
- Browser version of danfo.
- danfo - 0.2.5
To Reproduce
- Generate a dataframe with 3 text columns and one numeric column.
- Run a groupby -
const dfGroup = df.groupby(["col1", "col2","col3"]) - Perform an aggregation
dfGroup.col(["numeric_col"]).sum()
Expected behavior I get a dataframe with aggregation by all 3 columns. Instead I’m getting a dataframe with aggregation by a single column.
Is this currently a restriction or is this a bug?
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Using group by on multiple columns - Stack Overflow
GROUP BY (clause can be used in a SELECT statement to collect data across multiple records and group the results by one or...
Read more >Introduction to SQL GROUP BY Multiple Columns - eduCBA
We can group the resultset in SQL on multiple column values. When we define the grouping criteria on more than one column, all...
Read more >Group by Multiple Columns in SQL - Scaler Topics
The group by multiple columns technique retrieves grouped column values from one or more database tables by considering more than one column as ......
Read more >How to Group by Two Columns in SQL - LearnSQL.com
Problem: You want to group your data by two columns so you can count some statistics. Example: In the order table, you have...
Read more >SQL Group By Multiple Columns - Linux Hint
The group by clause in SQL allows you to aggregate records into a set of groups. SQL Group By Multiple Columns is discussed...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

that’s true, currently it only group by two column
@dom-devel you can now group by more than two columns in the new update