Closed lopollar closed 1 year ago
In the whole process, this code is the slowest:
i='nucleus_boundaries' sdata.add_shapes( name=i, shapes=spatialdata.models.ShapesModel.parse( sdata[i][np.isin(sdata[i].index.values, sdata.table.obs.index.values)] ), overwrite=True, ) And I can't think of why, does anyone have an idea?
It is because of np.isin on strings, if you add astype(int) for both, everything goes waaaay faster, like 100 times or so
In the whole process, this code is the slowest:
i='nucleus_boundaries' sdata.add_shapes( name=i, shapes=spatialdata.models.ShapesModel.parse( sdata[i][np.isin(sdata[i].index.values, sdata.table.obs.index.values)] ), overwrite=True, ) And I can't think of why, does anyone have an idea?