Last active
December 14, 2019 12:20
-
-
Save sam-drew/c6a5cfa55b924a34e0f4736eb26452db to your computer and use it in GitHub Desktop.
Extract airports which have an IATA code from the full dataset.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| data = None | |
| extractedData = [] | |
| with open("airport-codes_json.json", "r") as read_file: | |
| data = json.load(read_file) | |
| for item in data: | |
| if item.iata_code != None: | |
| extractedData.append(item) | |
| with open("iata_only.json", "w") as write_file: | |
| json.dump(data, write_file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment