November 2017
Beginner to intermediate
204 pages
5h 23m
English
Since data usually consists of a sequence of entries, the natural way to apply programmatic operations on each entry is to use a for loop.
After the new_scf_data array is created, create a for loop. The for loop should iterate over each of the data entries in the original dataset. In the body of the for loop, create a new Python dictionary called new_entry. The new_entry dictionary will contain the extracted variables from the entry of the original dataset. The following continuation of process_data.py demonstrates how this is done:
############ DATA MODIFICATION #############new_scf_data = []for old_entry in scf_data["issues"]: new_entry={}
Read now
Unlock full access