You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I was using this repo for a personal project and I decide to update the version and then I notice that the results of groupby aggregate function are totally different (I think that they are incorrect in the new version), here is an example:
importnumpy_groupiesasnpgimportnumpyasnpx=np.array([
[ 1., 2.],
[ 4., 4.],
[ 5., 2.],
[np.nan, 3.],
[ 8., 7.]]
)
group_idx=np.array([1, 2, 2, 0, 1])
func='nanmax'fill_value=np.nanaxis=0npg.aggregate(group_idx, x, axis=axis, func=func, fill_value=fill_value)
# Result with V0.9.14, which I think is correct, because it match with the Xarray code in the last partarray([[nan, 3.],
[ 8., 7.],
[ 5., 4.]])
# Result with V0.9.16, you can notice that both results contain the same values, but this in particular has a different orderarray([[nan, 8.],
[ 5., 3.],
[ 7., 4.]])
# The expected result can be obtained using Xarray groupby, which is the same than in the V0.9.14
import xarray as xr
xr.DataArray(
x,
coords={
'a': [0, 1, 2, 3, 4],
'b': [0, 1]
}
).groupby(
xr.DataArray(
group_idx,
dims=['a']
)
).max()
The text was updated successfully, but these errors were encountered:
josephnowak
changed the title
Different results from V0.9.14 and V0.9.16
Different results in V0.9.14 than in V0.9.16
May 30, 2022
Hi, I was using this repo for a personal project and I decide to update the version and then I notice that the results of groupby aggregate function are totally different (I think that they are incorrect in the new version), here is an example:
The text was updated successfully, but these errors were encountered: