Lightweight representations of networks using Pandas DataFrames.
Project description
networkframe
Lightweight representations of networks using Pandas DataFrames.
- Documentation: https://bdpedigo.github.io/networkframe
- GitHub: https://github.com/bdpedigo/networkframe
- PyPI: https://pypi.org/project/networkframe/
- Free software: MIT
networkframe
uses Pandas DataFrames to represent networks in a lightweight way.
A NetworkFrame
object is simply a table representing nodes and a table representing
edges, and a variety of methods to make querying and manipulating that data easy.
Pros:
- Lightweight:
NetworkFrame
objects are just two DataFrames, so they're easy to manipulate and integrate with other tools. - Interoperable: can output to
NetworkX
,numpy
andscipy
sparse matrices, and other formats (coming soon). - Flexible: can represent directed, undirected, and multigraphs.
- Familiar: if you're familiar with
Pandas
DataFrames
, that is. As much as possible,networkframe
uses the same syntax asPandas
, but also just gives you access to the underlying tables. - Extensible: it's easy to use
NetworkFrame
as a base graph - for instance, you could make aSpatialNetworkFrame
that adds spatial information to the nodes and edges.
Cons:
- No guarantees: since
networkframe
gives you access to the underlyingDataFrames
, it doesn't do much validation of the data. - Not optimized for graph computations: since
networkframe
is storing data as simple node and edge tables, it's not optimized for doing actual computations on those graphs (e.g. like searching for shortest paths). A typical workflow would be to usenetworkframe
to load and manipulate your data, then convert to a more graph-oriented format likescipy
sparse matrices orNetworkX
for computations.
Room for improvement:
- Early development: there are likely bugs and missing features. Please report any issues you find!
- More interoperability:
networkframe
can currently output toNetworkX
,numpy
andscipy
sparse matrices, and other formats (coming soon). It would be nice to be able to read in from these formats as well. - Graph-type handling:
networkframe
has mainly been tested on directed graphs, less so for undirected and multigraphs.
Credits
This package was created with Cookiecutter and the bdpedigo/cookiecutter-pypackage project template (which builds on several previous versions).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file networkframe-0.3.0.tar.gz
.
File metadata
- Download URL: networkframe-0.3.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd44aa62bb5274b58ffb2b53632f5247a614b9470c88c69c4648eb00d5df7fa9 |
|
MD5 | b99654326c340a0ada9dec4b9457bd77 |
|
BLAKE2b-256 | fdd498de1e268778682fc2658499bba512cfd1abb6f31c155dd0630e7a50946e |
File details
Details for the file networkframe-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: networkframe-0.3.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 193ee14e40a426e4c1e38a28881825aa287a123626bdd17ed9c1d840407d2d9e |
|
MD5 | cb0c6500fbc2b3458292f0016a3ae953 |
|
BLAKE2b-256 | 0797877c1fca2d82aff91556b1c9960f4867ceee01cd4deffdda5de2ffc43e7b |