My python code gives the error, KeyError: 'precipi', when running the following code:
dayconditions =(date+ "," + data['history']['observations'][yy]['hum']+ "%" + "," +data['history']['observations'][yy]['wdire']+ "," + data['history']['observations'][yy]['wspdi']+ " mph" + data['history']['observations'][yy]['precipi']+ " in" )
The code works to get the correct humidity and wind data, but gives an error when I add the last part. Can anyone help me with what I'm doing wrong as far as the precipitation rate goes?
Thanks!
dayconditions =(date+ "," + data['history']['observations'][yy]['hum']+ "%" + "," +data['history']['observations'][yy]['wdire']+ "," + data['history']['observations'][yy]['wspdi']+ " mph" + data['history']['observations'][yy]['precipi']+ " in" )
The code works to get the correct humidity and wind data, but gives an error when I add the last part. Can anyone help me with what I'm doing wrong as far as the precipitation rate goes?
Thanks!