# Convert VertexCluster to 2d Numpy array

**URL:** <https://igraph.discourse.group/t/convert-vertexcluster-to-2d-numpy-array/861>\
**Category:** Usage\
**Tags:** Python\
**Created:** [13 September 2021 13:32 UTC](https://igraph.discourse.group/t/convert-vertexcluster-to-2d-numpy-array/861 "2021-09-13T13:32:46Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![balandongiv](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/balandongiv/32/553_2.png) [@balandongiv](https://igraph.discourse.group/u/balandongiv)\
**Post date:** [16 September 2021 12:51 UTC](https://igraph.discourse.group/t/convert-vertexcluster-to-2d-numpy-array/861/3 "2021-09-16T12:51:45Z")

</div>

> [@vtraag](#):
>
> It might be most useful to convert the results first in an easy to use representation. The following code transforms the membership into a dict-of-dicts, representing the membership of each node in each slice:

Thanks for the suggestion, presenting the membership as proposed above remove ambiguity about the node membership.

> [@vtraag](#):
>
> Here, node `A` for slice `2` is missing, indicated by `NaN` (not a number). Notice that the membership for slice 2 is now a `float` instead of an `int` , because an `int` cannot represent `NaN` .

The graph (with missing node A) used in this discussion is not ideal for the [flexibility calculation](https://igraph.discourse.group/t/how-to-quantify-time-dependent-network-flexibility-in-igraph/843/7). This metric is usually used in neuro-image research, and rarely there are missing node (brain region/node).

---

_[View the full topic](https://igraph.discourse.group/t/convert-vertexcluster-to-2d-numpy-array/861)._
