Thursday, 6 January 2022

How can repetitive rows of data be collected in a single row in pandas?

I have a dataset that contains the NBA Player's average statistics per game. Some player's statistics are repeated because of they've been in different teams in season. For example:

      Player       Pos  Age Tm    G     GS   MP      FG
8   Jarrett Allen   C   22  TOT  28     10  26.2     4.4
9   Jarrett Allen   C   22  BRK  12     5   26.7     3.7
10  Jarrett Allen   C   22  CLE  16     5   25.9     4.9

I want to average Jarrett Allen's stats and put them into a single row. How can i do this? Thanks in advance.



from How can repetitive rows of data be collected in a single row in pandas?

No comments:

Post a Comment