Understanding syntax `clustering(G[, nodes, weight])`

Question:

A lot of functions in NetworkX are mentioned like this in the reference. What does this mean starting the square bracket with a comma.
e.g. clustering(G[, nodes, weight]) node_redundancy(G[, nodes]) etc. without any first argument.

Is this python syntax or networkx convention?

Asked By: Rys

||

Answers:

clustering(G[, nodes, weight]) simply means that the function clustering() takes one required argument G, and optionally two other arguments – nodes and weight. This is fairly standard notation in documentation, regardless of language.

Answered By: MattDMo
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.