I have the following code (below). getting an error because some wind_gust records are null. When this happens I want to backfill with a null value, instead. How can I do this?
req = requests.get(api_request_url, params=api_arguments)
data = json.loads(req.text)
rows = []
for i in data["STATION"]:
length = len(i["OBSERVATIONS"]["date_time"])
for j in range(length):
try: row = {
"stationId": i["STID"],
"wind": i["OBSERVATIONS"]["wind_gust"][j],
except KeyError: pass
1