# TypeError: ufunc 'isfinite' not supported for the input types

**URL:** <https://community.naturalcapitalalliance.org/t/typeerror-ufunc-isfinite-not-supported-for-the-input-types/5547>\
**Category:** Software Support\
**Tags:** habitat-quality\
**Created:** [October 28, 2024, 5:12pm UTC](https://community.naturalcapitalalliance.org/t/typeerror-ufunc-isfinite-not-supported-for-the-input-types/5547 "2024-10-28T17:12:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hannah\_m](https://avatars.discourse-cdn.com/v4/letter/h/848f3c/32.png) [@hannah\_m](https://community.naturalcapitalalliance.org/u/hannah_m)\
**Post date:** [October 28, 2024, 5:12pm UTC](https://community.naturalcapitalalliance.org/t/typeerror-ufunc-isfinite-not-supported-for-the-input-types/5547/1 "2024-10-28T17:12:41Z")

</div>

Hello,

I’m trying to run the habitat quality model but am now stuck with the following error:

TypeError: ufunc ‘isfinite’ not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ‘‘safe’’

You can also find the full log here:  
[InVEST-natcap.invest.habitat\_quality-log-2024-10-27–19\_05\_16.txt](https://community.naturalcapitalalliance.org/uploads/short-url/dvHooJetF52c641oGp5hrjRc16I.txt) (5.8 KB)

I thought there might be a problem with the tiff that contains the lulc data, but to me everything looks in order (the fields have a numeric data type).

I would be grateful for some help!

Hannah

---

<div class="post-metadata">

**Author:** ![dave](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dave/32/70_2.png) [@dave](https://community.naturalcapitalalliance.org/u/dave)\
**Post date:** [October 29, 2024, 2:02pm UTC](https://community.naturalcapitalalliance.org/t/typeerror-ufunc-isfinite-not-supported-for-the-input-types/5547/2 "2024-10-29T14:02:46Z")

</div>

Hi @hannah_m , thanks for reporting this issue. If the LULC raster looks okay, the problem could be in the table used to reclassify the raster. Perhaps a missing value in the Sensitivity table for example.

If you can share your LULC raster and CSV inputs, we can try to reproduce this. If there is a data problem, we can try to provide a better error message in the future.

Thanks,

---

<div class="post-metadata">

**Author:** ![dave](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dave/32/70_2.png) [@dave](https://community.naturalcapitalalliance.org/u/dave)\
**Post date:** [October 31, 2024, 6:58pm UTC](https://community.naturalcapitalalliance.org/t/typeerror-ufunc-isfinite-not-supported-for-the-input-types/5547/4 "2024-10-31T18:58:13Z")

</div>

Thanks for sharing your data! It looks like there is a row in the sensitivity table that has a missing value in the lulc column. Could you try filling in the value or removing the row and let us know if that solves the problem?

 ![Capture](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/0/039c71a6d981befb313e774e20bf97e3b437ed88.png)

---

<div class="post-metadata">

**Author:** ![hannah\_m](https://avatars.discourse-cdn.com/v4/letter/h/848f3c/32.png) [@hannah\_m](https://community.naturalcapitalalliance.org/u/hannah_m)\
**Post date:** [November 1, 2024, 1:39pm UTC](https://community.naturalcapitalalliance.org/t/typeerror-ufunc-isfinite-not-supported-for-the-input-types/5547/5 "2024-11-01T13:39:02Z")

</div>

Hi dave,

I removed the row and now everything works. Thank you for your help!

Hannah

---

<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:** [November 8, 2024, 1:40pm UTC](https://community.naturalcapitalalliance.org/t/typeerror-ufunc-isfinite-not-supported-for-the-input-types/5547/6 "2024-11-08T13:40:04Z")

</div>

Closed on November 8, 2024, 1:40pm UTC

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