question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Groupby with more than two columns isn't possible

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
steveonicommented, Apr 6, 2021

that’s true, currently it only group by two column

0reactions
steveonicommented, Jun 9, 2021

@dom-devel you can now group by more than two columns in the new update

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found