'Using xclim to define heatwaves (python)

I'm currently trying to create a data set that contains information of the days that are counted as a heatwave. I am using xclim and the tx90p index however running into some issues with it. This is the code that i have at the moment:

t90 = xclim.core.calendar.percentile_doy(data.ts, per=90).sel(percentiles=90) 

hot_days = xclim.indices.tx90p(data.ts, t90)

The result is i'm getting an error of "AttributeError: module 'pint' has no attribute 'Quantity'" Has anyone come across this/know how to make it work?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source