# KeyError encountered: '11.0' when running water yield model

**URL:** <https://community.naturalcapitalalliance.org/t/keyerror-encountered-11-0-when-running-water-yield-model/2027>\
**Category:** Software Support\
**Tags:** annual-water-yield\
**Created:** [June 29, 2021, 4:44pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-11-0-when-running-water-yield-model/2027 "2021-06-29T16:44:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hollandmeg98](https://avatars.discourse-cdn.com/v4/letter/h/bc79bd/32.png) [@hollandmeg98](https://community.naturalcapitalalliance.org/u/hollandmeg98)\
**Post date:** [June 29, 2021, 4:44pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-11-0-when-running-water-yield-model/2027/1 "2021-06-29T16:44:39Z")

</div>

Hello everyone.  
When trying to run the Hydropower Water Yield Model, I have encountered an error with the message:  
KeyError encountered: ‘11.0’

2021-06-29 12:35:23,430 hydropower\_water\_yield.execute(101) INFO Validating arguments  
2021-06-29 12:35:23,436 validation.\_wrapped\_validate\_func(148) DEBUG Validation warnings: []  
2021-06-29 12:35:23,457 geoprocessing.align\_and\_resize\_raster\_stack(729) INFO n\_workers \> 1 (2) so starting a processes pool.  
2021-06-29 12:35:25,887 geoprocessing.align\_and\_resize\_raster\_stack(779) INFO 1 of 5 aligned: eto.tif  
2021-06-29 12:35:30,457 geoprocessing.align\_and\_resize\_raster\_stack(779) INFO 2 of 5 aligned: precip.tif  
2021-06-29 12:35:30,457 geoprocessing.align\_and\_resize\_raster\_stack(779) INFO 3 of 5 aligned: depth\_to\_root\_rest\_layer.tif  
2021-06-29 12:35:30,459 geoprocessing.align\_and\_resize\_raster\_stack(779) INFO 4 of 5 aligned: pawc.tif  
2021-06-29 12:35:30,999 geoprocessing.align\_and\_resize\_raster\_stack(779) INFO 5 of 5 aligned: clipped\_lulc.tif  
2021-06-29 12:35:31,082 geoprocessing.align\_and\_resize\_raster\_stack(788) INFO aligned all 5 rasters.  
2021-06-29 12:35:31,230 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 17  
2021-06-29 12:35:31,232 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 18  
2021-06-29 12:35:31,232 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 19  
2021-06-29 12:35:31,233 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 20  
2021-06-29 12:35:31,233 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 21  
2021-06-29 12:35:31,233 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 22  
2021-06-29 12:35:31,234 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 23  
2021-06-29 12:35:31,234 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 24  
2021-06-29 12:35:31,236 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 25  
2021-06-29 12:35:31,236 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 26  
2021-06-29 12:35:31,237 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 27  
2021-06-29 12:35:31,239 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 28  
2021-06-29 12:35:31,240 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 29  
2021-06-29 12:35:31,240 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 30  
2021-06-29 12:35:31,240 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 31  
2021-06-29 12:35:31,242 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 32  
2021-06-29 12:35:31,242 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 33  
2021-06-29 12:35:31,243 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 34  
2021-06-29 12:35:31,243 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 35  
2021-06-29 12:35:31,243 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 36  
2021-06-29 12:35:31,244 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 37  
2021-06-29 12:35:31,246 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 38  
2021-06-29 12:35:31,246 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 39  
2021-06-29 12:35:31,247 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 40  
2021-06-29 12:35:31,249 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 41  
2021-06-29 12:35:31,249 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 42  
2021-06-29 12:35:31,250 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 43  
2021-06-29 12:35:31,250 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 44  
2021-06-29 12:35:31,250 utils.build\_lookup\_from\_csv(479) WARNING Encountered an entirely blank row on line 45  
2021-06-29 12:35:31,286 hydropower\_water\_yield.execute(236) DEBUG bio\_lucodes set([’’, 11.0, 71.0, 41.0, 42.0, 43.0, 255.0, 81.0, 82.0, 52.0, 21.0, 22.0, 23.0, 24.0, 90.0, 31.0, 95.0])  
2021-06-29 12:35:31,289 hydropower\_water\_yield.\_check\_missing\_lucodes(724) INFO Checking that input tables have landcover codes for every value in the landcover map.  
2021-06-29 12:35:31,730 hydropower\_water\_yield.execute(278) INFO Reclassifying temp\_Kc raster  
2021-06-29 12:35:31,733 Task.add\_task(636) ERROR Something went wrong when adding task create\_Kc\_raster (2), terminating taskgraph.  
Traceback (most recent call last):  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add\_task  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1068, in \_call  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 1747, in reclassify\_raster  
KeyError: ‘11.0’  
2021-06-29 12:35:31,733 model.\_logged\_target(1639) ERROR Exception while executing \<function execute at 0x10ED2670\>  
Traceback (most recent call last):  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1636, in \_logged\_target  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\hydropower\hydropower\_water\_yield.py”, line 287, in execute  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add\_task  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1068, in \_call  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 1747, in reclassify\_raster  
KeyError: ‘11.0’

has anyone else encountered this particular error before, and if so, how did you handle it?

Many thanks.

---

<div class="post-metadata">

**Author:** ![jesseG](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jesseg/32/1068_2.png) [@jesseG](https://community.naturalcapitalalliance.org/u/jesseG)\
**Post date:** [June 29, 2021, 6:11pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-11-0-when-running-water-yield-model/2027/2 "2021-06-29T18:11:26Z")

</div>

Hi @hollandmeg98 ,

Welcome to the forum!

Are you using the Annual Water Yield or the Seasonal Water Yield model? Key errors are common. Check that there is a value of `11.0` in your biophysical table, and add a row for it if it’s not already there. If a value is included in the land cover raster that is not included as a row in the biophysical table, you will receive this type of error.

Also check that there is not a value of `11.0` in your soil group raster. The values for soil groups for this model can only be `1`, `2`, `3`, or `4`, but sometimes there are other values assigned to soil groups. If this is what’s happening, you’ll need to reassign the soil group raster value of `11.0` to one of the allowed classes of `1` through `4`. If this isn’t what’s happening, then please do ATTACH your log file (ending in extension `.txt`) here, rather than pasting its contents, so that we can look more closely.

Thanks,  
Jesse

---

<div class="post-metadata">

**Author:** ![hollandmeg98](https://avatars.discourse-cdn.com/v4/letter/h/bc79bd/32.png) [@hollandmeg98](https://community.naturalcapitalalliance.org/u/hollandmeg98)\
**Post date:** [June 29, 2021, 9:03pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-11-0-when-running-water-yield-model/2027/3 "2021-06-29T21:03:47Z")

</div>

Hi Jesse,

Thanks for the quick response. I am using the Annual Water Yield Model.  
I was able to fix this problem by removing unnecessary values from my biophysical table, and reassigning soil group values.

Have a great one.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/8/8d95591aa074da87ea0fdd61ca47c1c3c0588aa7.png) [@system](https://community.naturalcapitalalliance.org/u/system)\
**Post date:** [July 6, 2021, 9:04pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-11-0-when-running-water-yield-model/2027/4 "2021-07-06T21:04:17Z")

</div>

Closed on July 6, 2021, 9:04pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
