4
我有一個DataFrame
3列即Id, First Name, Last Name
阿帕奇星火數據框GROUPBY AGG()爲多列
我想要的Id
的基礎上,運用GroupBy
並希望收集First Name, Last Name
列清單。
例子: - 我有一個DF這樣
+---+-------+--------+
|id |fName |lName |
+---+-------+--------+
|1 |Akash |Sethi |
|2 |Kunal |Kapoor |
|3 |Rishabh|Verma |
|2 |Sonu |Mehrotra|
+---+-------+--------+
,我想這樣的
+---+-------+--------+--------------------+
|id |fname |lName |
+---+-------+--------+--------------------+
|1 |[Akash] |[Sethi] |
|2 |[Kunal, Sonu] |[Kapoor, Mehrotra] |
|3 |[Rishabh] |[Verma] |
+---+-------+--------+--------------------+
感謝我提前輸出