Skip to content

Commit

Permalink
BUG: Squeeze when using interpolate_na with extra dim (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 authored Oct 2, 2024
1 parent b423d94 commit c092fcf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rioxarray/raster_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,12 +1054,13 @@ def interpolate_na(
interp_data = []
for _, sub_xds in self._obj.groupby(extra_dim):
interp_data.append(
self._interpolate_na(sub_xds.load().data, method=method)
self._interpolate_na(
sub_xds.squeeze(dim=extra_dim).values, method=method
)
)
interp_data = numpy.array(interp_data) # type: ignore
else:
interp_data = self._interpolate_na(self._obj.load().data, method=method) # type: ignore

interp_data = self._interpolate_na(self._obj.values, method=method) # type: ignore
interp_array = xarray.DataArray(
name=self._obj.name,
data=interp_data,
Expand Down

0 comments on commit c092fcf

Please sign in to comment.