QuestionQ66
VerifiedData Processing & TransformationsA data engineering team is analyzing customer transactions with a PySpark DataFrame named transactions, containing the columns customer_id, amount, and category.
For every customer, the team must calculate the total transaction amount, average transaction amount, and maximum amount—all in one operation for efficiency.
Which PySpark code fragment accomplishes this?
Community Discussion