โ11-09-2023 12:46 PM
I'm trying this code but getting the following error
testDF = (eventsDF .groupBy("user_id") .pivot("event_name") .count("event_name"))
TypeError: _api() takes 1 positional argument but 2 were given
Please guide how to fix the error
โ11-10-2023 09:08 AM
Try this
from pyspark.sql import functions as F testDF = (eventsDF .groupBy("user_id") .pivot("event_name") .agg(F.count("event_name")))
never-displayed
Passionate about hosting events and connecting people? Help us grow a vibrant local communityโsign up today to get started!