0

So I have a few csv files that contain annual football stats, that I'm trying to compile into a single data frame to show overall stats in a given time period.The Data The teams in the stat list vary based on which teams were relegated or promoted. The stats are stored per season, I'm looking to write a function that takes two data frames, and adds the values of the stats. I tried using df.add(), but it's using the auto-assigned index to add the rows together, it also concatenates the string values i.e (ArsenalArsenal), etc. and if there's a new team it just uses the row index (i.e ArsenalIpswich) which leads to it adding the stats of 2 different teams.

How should I go about this, I was thinking of concatenating the data frames then totaling the stats with the same id, but I'm not sure how to handle the string values and values like id that shouldn't be totaled. There are like 260 columns so I don't think manually writing cases for all of them would be feasible. Any suggestions?

Manish A G
  • 28
  • 4

0 Answers0