# Incidence matrix from bipartite graph in python-igraph

**URL:** <https://igraph.discourse.group/t/incidence-matrix-from-bipartite-graph-in-python-igraph/1270>\
**Category:** Usage\
**Tags:** Python\
**Created:** [24 June 2022 08:47 UTC](https://igraph.discourse.group/t/incidence-matrix-from-bipartite-graph-in-python-igraph/1270 "2022-06-24T08:47:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jboynyc](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/jboynyc/32/240_2.png) [@jboynyc](https://igraph.discourse.group/u/jboynyc)\
**Post date:** [24 June 2022 08:47 UTC](https://igraph.discourse.group/t/incidence-matrix-from-bipartite-graph-in-python-igraph/1270/1 "2022-06-24T08:47:39Z")

</div>

What is the most efficient way of returning the incidence matrix of a bipartite graph in Python? I see that the R interface comes with a helper function called [`as_incidence_matrix`](https://igraph.org/r/html/latest/as_incidence_matrix.html), but I don’t see anything comparable in python-igraph.

(Essentially I am looking for the inverse of [`igraph.Graph.Incidence`](https://igraph.org/python/api/latest/igraph.Graph.html#Incidence), which allows building a graph from an incidence matrix.)

---

<div class="post-metadata">

**Author:** ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)\
**Post date:** [25 June 2022 19:32 UTC](https://igraph.discourse.group/t/incidence-matrix-from-bipartite-graph-in-python-igraph/1270/2 "2022-06-25T19:32:48Z")

</div>

It’s the `get_incidence` method.

---

<div class="post-metadata">

**Author:** ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)\
**Post date:** [23 April 2025 10:15 UTC](https://igraph.discourse.group/t/incidence-matrix-from-bipartite-graph-in-python-igraph/1270/3 "2025-04-23T10:15:25Z")

</div>

Note to people who might come across this thread:

igraph now uses the term “biadjacency matrix” instead of “incidence matrix” to refer to to the matrix that contains the edge counts between vertices of a bipartite graph.

Going forward, “incidence matrix” will be used to refer to [the edge-vertex incidence matrix](https://en.wikipedia.org/wiki/Incidence_matrix#Undirected_and_directed_graphs), which is the more standard use of this term in graph theory.

Old function names with “incidence” are now deprecated and will likely be re-used for the edge-vertex incidence matrix in a future release.
