Skip to content

Reimarleo/Python-exercise-for-graduates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python-exercise-for-graduates

Please send any questions and the script when ready to: mario.farina@kantarmedia.com

You can also publish the script to your GitHub if you have one.

The task

The task is to write a script that reads the two files Data file 1.csv and Data file 2.csv and combines them into a new file. The result should be the same as the file Data file full.csv, which is only provided as an example of what the result should look like.

Both files are CSVs (comma separated) with two fields:

  1. Serial ID
  2. A variable

The output of the script should have the following fields

  1. Serial ID
  2. Variable from Data file 1
  3. Variable from Data file 2

Effectively your program will do the same as an Excel lookup, which is matching the Serial IDs in both files to add the information from Data file 2 to Data file 1.

In order to complete the task you need to know how to:

Reading and writing files

Deal with substrings

Loop through every line in the files

Split comma delimited fields in strings

Use dictionaries

There is also a Script.py file with some pseudocode to get you started.

If you are new to programming or Python

Install the Anaconda package. I recommend 3.6.

Once the installation is complete, you can launch Spyder and start scripting! This tutorial can help.

Other languages

Feel free to complete the exercise in C# or Java if you prefer.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages