xgi.convert.higher_order_network

Methods for converting to higher-order network objects.

Functions

xgi.convert.higher_order_network.to_hypergraph(data, create_using=None)[source]

Make a hypergraph from a known data structure.

The preferred way to call this is automatically from the class constructor.

Parameters:
  • data (object to be converted) –

    Current known types are:
    • a Hypergraph object

    • a SimplicialComplex object

    • list-of-iterables

    • dict-of-iterables

    • Pandas DataFrame (bipartite edgelist)

    • numpy matrix

    • numpy ndarray

    • scipy sparse matrix

  • create_using (Hypergraph constructor, optional (default=Hypergraph)) – Hypergraph type to create. If hypergraph instance, then cleared before populated.

Returns:

A hypergraph constructed from the data

Return type:

Hypergraph object

See also

from_max_simplices

Constructs a hypergraph from the maximal simplices of a simplicial complex.

xgi.convert.higher_order_network.to_dihypergraph(data, create_using=None)[source]

Make a dihypergraph from a known data structure.

The preferred way to call this is automatically from the class constructor.

Parameters:
  • data (object to be converted) –

    Current known types are:
    • a DiHypergraph object

    • a SimplicialComplex object

    • list-of-iterables

    • dict-of-iterables

    • Pandas DataFrame (bipartite edgelist)

    • numpy matrix

    • numpy ndarray

    • scipy sparse matrix

  • create_using (Hypergraph constructor, optional (default=Hypergraph)) – Hypergraph type to create. If hypergraph instance, then cleared before populated.

Returns:

A hypergraph constructed from the data

Return type:

Hypergraph object

xgi.convert.higher_order_network.to_simplicial_complex(data, create_using=None)[source]

Make a hypergraph from a known data structure. The preferred way to call this is automatically from the class constructor.

Parameters:
  • data (object to be converted) –

    Current known types are:
    • a SimplicialComplex object

    • a Hypergraph object

    • list-of-iterables

    • dict-of-iterables

    • Pandas DataFrame (bipartite edgelist)

    • numpy matrix

    • numpy ndarray

    • scipy sparse matrix

  • create_using (Hypergraph graph constructor, optional (default=Hypergraph)) – Hypergraph type to create. If hypergraph instance, then cleared before populated.

Returns:

A hypergraph constructed from the data

Return type:

Hypergraph object