# Habitat Quality Error - 'float' and 'str'

**URL:** <https://community.naturalcapitalalliance.org/t/habitat-quality-error-float-and-str/4593>\
**Category:** Software Support\
**Tags:** habitat-quality\
**Created:** [March 29, 2024, 11:09pm UTC](https://community.naturalcapitalalliance.org/t/habitat-quality-error-float-and-str/4593 "2024-03-29T23:09:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anaacruz](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anaacruz](https://community.naturalcapitalalliance.org/u/anaacruz)\
**Post date:** [March 29, 2024, 11:09pm UTC](https://community.naturalcapitalalliance.org/t/habitat-quality-error-float-and-str/4593/1 "2024-03-29T23:09:36Z")

</div>

Hello InVEST Community,

I recently ran the Habitat Quality model for the first time and encountered an error message: " TypeError: unsupported operand type(s) for +: ‘float’ and ‘str’ ". Despite the quick appearance of this error, all my input data seemed to be functioning correctly. I’m wondering if anyone has encountered a similar issue or has any insights into what might be causing it.

Thank you in advance.  
Ana

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [March 30, 2024, 12:30am UTC](https://community.naturalcapitalalliance.org/t/habitat-quality-error-float-and-str/4593/2 "2024-03-30T00:30:34Z")

</div>

Hello @anaacruz is it possible that a required table column is blank? This is the most common cause of this issue.

If that doesn’t make sense or isn’t the cause, could you provide your logfile so we can take a closer look at where, specifically, the model is crashing?

Thanks!  
James

---

<div class="post-metadata">

**Author:** ![anaacruz](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anaacruz](https://community.naturalcapitalalliance.org/u/anaacruz)\
**Post date:** [April 1, 2024, 11:42pm UTC](https://community.naturalcapitalalliance.org/t/habitat-quality-error-float-and-str/4593/3 "2024-04-01T23:42:36Z")

</div>

Hello @jdouglass ! Thank you for the prompt response.

I noticed that there were blank columns (since I am only using current LULC, I thought base and future LULC would also need to be indicated in columns, but with the data blank, as in the UserGuide), so I deleted the blank columns, but the model still threw the same error when running.

I will share the logfile (would that be it?)

Thank you very much!!  
Ana

[InVEST-natcap.invest.habitat\_quality-log-2024-04-01–20\_35\_28.txt](https://community.naturalcapitalalliance.org/uploads/short-url/u6Jk1nmVgrd0BwaTYsfQwjhgjdj.txt) (2.6 KB)

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [April 22, 2024, 5:51pm UTC](https://community.naturalcapitalalliance.org/t/habitat-quality-error-float-and-str/4593/4 "2024-04-22T17:51:52Z")

</div>

Thanks for your logfile @anaacruz! The specific error here is happening because there is a value in the `THREAT` column of your threats table that is being interpreted as a text string and not a number. I would suggest that you verify that all values of the `THREAT` column are, in fact, numbers. If that still doesn’t resolve the issue, please attach your threats table here and we can take a closer look.

James

---

<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:** [May 10, 2024, 7:24pm UTC](https://community.naturalcapitalalliance.org/t/habitat-quality-error-float-and-str/4593/5 "2024-05-10T19:24:29Z")

</div>

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