'Pyspark : TypeError: _api() takes 1 positional argument

I use this code for the pivot on the dataframe :

df2 = df.groupBy("id").pivot("status").count("status")
df = df.join(df2, on="id", how='left')

But I obtain this error : TypeError: _api() takes 1 positional argument but 2 were given

Please, can we help me ??



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source