Created
May 15, 2020 18:38
-
-
Save siakon89/5c4ff88fdd14595b76524da0f6ee0b25 to your computer and use it in GitHub Desktop.
This file contains 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
# GroupBy a column and count | |
df.groupby("column").count().show() | |
# GroupBy a column and sum | |
df.groupby("column1").sum("column2").show() | |
# GroupBy with multiple columns | |
df.groupby("column1", "column2").count().show() | |
# GroupBy with multiple columns and sum multiple columns | |
df.groupby("column1", "column2").sum("column3", "column4").show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment