We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efc1ac2 commit ab5b551Copy full SHA for ab5b551
climada/hazard/forecast.py
@@ -254,8 +254,12 @@ def quantile(self, q: float):
254
HazardForecast
255
A HazardForecast object with the quantile intensity and fraction.
256
"""
257
- red_intensity = sparse.csr_matrix(self.intensity.todense().quantile(q, axis=0))
258
- red_fraction = sparse.csr_matrix(self.fraction.todense().quantile(q, axis=0))
+ red_intensity = sparse.csr_matrix(
+ np.quantile(self.intensity.toarray(), q, axis=0)
259
+ )
260
+ red_fraction = sparse.csr_matrix(
261
+ np.quantile(self.fraction.toarray(), q, axis=0)
262
263
reduced_attrs = self._reduce_attrs(f"quantile_{q}")
264
return HazardForecast(
265
lead_time=reduced_attrs["lead_time"],
0 commit comments