Skip to content
Advertisement

Write new field with CSV writer

I am trying to write a new row on CSV A based on the ID number if the ID number. For example as seen on CSV B if ID = 1 then the student is a Female, ID = 2 is a Male.

CSV A (has 3 columns)

JavaScript

CSV B (has 2 columns)

JavaScript

Based on this information the desired output is below:

JavaScript

How can I achieve this using the Python csv writer?

Advertisement

Answer

I hope you are doing good, well this logic is basic but as you mentioned above you are new to python so I have done some code for your reference which is attached below

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement