Install
Tutorial
Reference
Releases
Developer
Gallery
Guides
Home Page
GitHub
v2.7.1
devel (latest)
current (stable)
Introduction
Graph types
Algorithms
Functions
Graph generators
Linear algebra
Converting to and from other data formats
to_networkx_graph
to_dict_of_dicts
from_dict_of_dicts
to_dict_of_lists
from_dict_of_lists
to_edgelist
from_edgelist
to_numpy_matrix
to_numpy_array
to_numpy_recarray
from_numpy_matrix
from_numpy_array
to_scipy_sparse_array
to_scipy_sparse_matrix
from_scipy_sparse_matrix
from_scipy_sparse_array
to_pandas_adjacency
from_pandas_adjacency
to_pandas_edgelist
from_pandas_edgelist
Relabeling nodes
Reading and writing graphs
Drawing
Randomness
Exceptions
Utilities
Glossary
to_edgelist
¶
to_edgelist
(
G
,
nodelist
=
None
)
[source]
¶
Returns a list of edges in the graph.
Parameters
G
graph
A NetworkX graph
nodelist
list
Use only nodes specified in nodelist