Events By Type

Easy
GroupBy
Aggregations
Salesforce
Twilio

Events By Type

Count rows per event_type in events and return as event_count. Sort by event_type ascending.

Sample input

event_typeevent_id
purchase1
signup2
purchase3
click4
click5
purchase6
Browser Engine: Evaluates PySpark DataFrame & SQL logic locally in Pyodide WebAssembly.

Input data

1 DataFrame

These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].

df.events10 rows
event_type (string)event_id (int)
purchase1
signup2
purchase3
click4
click5
purchase6
click7
click8
view9
click10

Return these columns

event_type(string)
event_count(long)

Column names and order must match. Sort order is specified in the question.

Browser engine
Loading Python editor…
Click Run to try the sample cases, or Submit to check the hidden cases. First run caches the browser Python engine (~8–15s once); all code stays on your device.