Add graph functionnalities to a Pandas dataframe through its extension capabilities.
This is an experimental package.
Netpandas adds graph functionalities on a standard pandas dataframe by a column of source-target node ids. Thus, the data model is edge-based, directed or not. Netpandas is initialised with netpandas.set_network() function, with source and target column names and a directed boolean. Graph functions are accessed behind a .net accessor.
. node properties : nodes, degree . edge properties : duplicated, loops, . connected components : df.net.filter_by_components
Netpandas provides backends and conversion functions to Networkx, Scipy and Pandana. Netpandas has functions to connect nodes based on spatial proximity. By using pandas accesor functionality, a Geopandas spatial dataframe can also be a graph dataframe without subclassing Geopandas.
Netpandas has functions for arcs (list of edges) and path (list of nodes). The functions are useful to deal with shortest path graph functions.
- when nodes have attributes
- when node ids are not integers
- when code is mostly base on the graph algorithms
Netpandans uses the accessor functionality from pandas. Some operations in pandas may drop the net accessor. See () If one of these pandas function is used, the accessor must be added by netpandas.set_network()
Documentation is available at (http://http://netpandas.readthedocs.io/)
Copyright (c) 2022, chourmo
Project based on the Computational Molecular Science Python Cookiecutter version 1.6.