Hypothetically, say I have two lists that have data as follows, and list A has multiple rows that I write into a csv via a for loop.
A = [Date, Round Number, Score, FirstName]
B = [FirstName, Surname]
Where every row of A is a different round in a sports tournament. List B contains every player's FirstName and Surname. This data is gathered from a GraphQL API query.
There are 100 rows of A in the CSV (100 rounds), and List B has 20 rows (20 players).
Question:
How would I be able to append a player's Surname into List A after every instance of their FirstName?
Disclaimer: I have no background in code, this is my first attempt at a python project.
I've checked out this post but I have not been able to find one without replacing. Update list elements based on a second list as index