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

Broadcasting #407

Open
leotrs opened this issue Jun 19, 2023 · 0 comments
Open

Broadcasting #407

leotrs opened this issue Jun 19, 2023 · 0 comments

Comments

@leotrs
Copy link
Collaborator

leotrs commented Jun 19, 2023

We have discussed this multiple times in one way or another. Essentially, it'd be great to have calls such as

>>> H.nodes.degree(order=1).aslist()
[0, 0, 0, 0, 1, 1, 0, 0]

automatically broadcast when asking for more than one order:

>>> H.nodes.degree(order=[1,2]).aslist()
# -> ?

Currently, the only way of getting the degree in two different orders is by using the multi method which is super clunky:

>>> nn = H.nodes
>>> nn.multi([nn.degree(order=1), nn.degree(order=2)]).aspandas()
   degree(order=1)  degree(order=2)
1                0                1
2                0                1
3                0                1
4                0                0
5                1                0
6                1                1
8                0                1
7                0                1

It would be much better for the call H.nodes.degree(order=[1,2]) to auatomatically broadcast and return a MultiStat object.

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

No branches or pull requests

1 participant