Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft of adjacency table as df #397

Merged
merged 3 commits into from
Apr 8, 2021
Merged

Draft of adjacency table as df #397

merged 3 commits into from
Apr 8, 2021

Conversation

sjsrey
Copy link
Member

@sjsrey sjsrey commented Apr 4, 2021

return self._cache["sparse"]
except KeyError:
weights = self.adjlist.weight
idxs = self.adjlist.focal.unique()
Copy link
Member

@ljwolf ljwolf Apr 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes that all focals are neighbours & vice versa. I think it needs something like

le = LabelEncoder.fit(numpy.hstack((self.adjlist.focal, self.adjlist.neighbor))
rows = le.transform(self.adjlist.focal)
cols = le.transform(self.adjlist.neighbor)

or the equivalent numpy.searchsorted on the set of unique(focal.union(neighbour))

@ljwolf ljwolf merged commit 06be845 into pysal:geographs Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants