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

Improve degree_counts doc #329

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion xgi/classes/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ def edge_neighborhood(H, n, include_self=False):


def degree_counts(H, order=None):
"""Returns a list of the frequency of each degree value.
"""Returns a list of the the number of occurrences of each degree value.

The counts correspond to degrees from 0 to max(degree).

Parameters
----------
Expand All @@ -198,6 +200,10 @@ def degree_counts(H, order=None):
Note: the bins are width one, hence len(list) can be large
(Order(num_edges))

The degree is defined as the number of edges to which a node belongs.
A node belonging only to a singleton edge will thus have degree 1 and
contribute accordingly to the degree count.

Examples
--------
>>> import xgi
Expand Down