Skip to content

Commit 6b7b13e

Browse files
authored
Merge pull request #221 from martinfleis/nonzero
COMPAT: fix compatibility with scipy 1.15
2 parents a60df09 + 46114ef commit 6b7b13e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tobler/area_weighted/area_interpolate.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
from tobler.util.util import _check_crs, _inf_check, _nan_check
1414

15-
__all__ = ['area_interpolate']
15+
__all__ = ["area_interpolate"]
16+
1617

1718
def _chunk_dfs(geoms_to_chunk, geoms_full, n_jobs):
1819
chunk_size = geoms_to_chunk.shape[0] // n_jobs + 1
@@ -250,7 +251,7 @@ def area_interpolate(
250251
- "source": build the spatial index on `source_df`
251252
- "target": build the spatial index on `target_df`
252253
- "auto": attempts to guess the most efficient alternative.
253-
254+
254255
Currently, this option uses the largest table to build the
255256
index, and performs a `bulk_query` on the shorter table.
256257
This argument is ignored if n_jobs>1 (or n_jobs=-1).
@@ -370,7 +371,7 @@ def area_interpolate(
370371
for value in unique:
371372
mask = source_df[variable] == value
372373
categorical[f"{variable}_{value}"] = np.asarray(
373-
table[mask].sum(axis=0)
374+
table[mask.to_numpy()].sum(axis=0)
374375
)[0]
375376

376377
categorical = pd.DataFrame(categorical)

0 commit comments

Comments
 (0)