parent
d72343c865
commit
98e0ef3881
|
@ -269,9 +269,10 @@ class Geom:
|
||||||
if len(unique) == grid.prod():
|
if len(unique) == grid.prod():
|
||||||
ma = np.arange(grid.prod())
|
ma = np.arange(grid.prod())
|
||||||
else:
|
else:
|
||||||
ma = np.empty(grid.prod(),'i')
|
from_ma = pd.unique(unique_inverse)
|
||||||
for to_ma,from_ma in enumerate(pd.unique(unique_inverse)):
|
sort_idx = np.argsort(from_ma)
|
||||||
ma[unique_inverse==from_ma] = to_ma
|
idx = np.searchsorted(from_ma,unique_inverse,sorter = sort_idx)
|
||||||
|
ma = np.arange(from_ma.size)[sort_idx][idx]
|
||||||
|
|
||||||
return Geom(ma.reshape(grid,order='F'),size,origin,util.execution_stamp('Geom','from_table'))
|
return Geom(ma.reshape(grid,order='F'),size,origin,util.execution_stamp('Geom','from_table'))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue