-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Labels
needs testinga pull request which needs testing added, or a bug/rough edge which exposes a functional testing gapa pull request which needs testing added, or a bug/rough edge which exposes a functional testing gapno-issue-activityrough edgeSomething that's not a bug, but that gets in the way of "it just works."Something that's not a bug, but that gets in the way of "it just works."weights
Milestone
Description
KNN correctly takes the index of the dataframe as the index of the weights, but rook does not.
from libpysal import weights
from libpysal import examples
import geopandas
columbus = geopandas.read_file(examples.get_path('columbus.shp'))
columbus_sub = columbus.sample(frac=1)
print(columbus_sub.index[0:5]) # should not be (0,1,2,3,4,) but instead random
Wr = weights.Rook.from_dataframe(columbus_sub)
Wknn1 = weights.KNN.from_dataframe(columbus_sub)
print(Wr.id_order) # is (0,1,2,3...)
print(Wknn1.id_order) # matches columbus_sub.index
These should behave the same everywhere, and I think they should behave like KNN, taking the indices from the dataframe directly.
Metadata
Metadata
Assignees
Labels
needs testinga pull request which needs testing added, or a bug/rough edge which exposes a functional testing gapa pull request which needs testing added, or a bug/rough edge which exposes a functional testing gapno-issue-activityrough edgeSomething that's not a bug, but that gets in the way of "it just works."Something that's not a bug, but that gets in the way of "it just works."weights