1

I am running a notebook on some golf stats that I found. In the example, it has 2018 and 2019 stats in the model. If I want to add 2020 and 2021 to the data, how do I go about with the following code:

df_stats = df_2018.join(df_2019, how='outer', lsuffix='_2018', rsuffix='_2019')

No Coding experience FYI Thanks

Anurag Dabas
  • 23,866
  • 9
  • 21
  • 41
NewbieO
  • 21
  • 1
  • Does this answer your question? [Pandas Merging 101](https://stackoverflow.com/questions/53645882/pandas-merging-101) – Anurag Dabas May 19 '21 at 05:30
  • I tried the concat one but I am getting errors now. I am not really sure what I am doing honestly.. – NewbieO May 19 '21 at 07:14
  • 1
    I found a solution for it but I am sure there is an easy way around it. I joined 2018-2019 & 2020-2021 and rewrote the same code as the original one. It does the trick. Thanks – NewbieO May 19 '21 at 07:46
  • without seeing your dataframe and your expected output from that dataframe its hard to tell what are you trying to do and also it is necessary for testing purpose **:/**...btw glad to know that you found solution without any help of others **:)** – Anurag Dabas May 19 '21 at 07:48
  • I'll provide more information next time I run into an error. Thanks for taking the time to provide a solution. Appreciate it – NewbieO May 19 '21 at 10:57

0 Answers0