Tools for converting network data to pajek files
Project description
Pajek Tools
Tools for converting network data to pajek files.
Pajek is a file format for networks, typically stored in files with a .net extension. It is used as input for software such as Infomap.
Installation
Install from PyPI:
pip install pajek-tools
Usage
Use the PajekWriter object to convert a network from an edgelist in pandas DataFrame form, to a Pajek .net file:
from pajek_tools import PajekWriter writer = PajekWriter(dataframe) writer.write("output.net")
Example
from pajek_tools import PajekWriter import pandas as pd df = pd.DataFrame([["a", "b"], ["a", "c"], ["c", "a"], ["c", "d"]], columns=["source", "target"]) writer = PajekWriter(df, directed=True, citing_colname="source", cited_colname="target") writer.write("output.net")
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2020-02-12)
First release on PyPI.
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
pajek_tools-0.1.3.tar.gz
(13.9 kB
view hashes)
Built Distribution
Close
Hashes for pajek_tools-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a33f530e2a4500b9398b8db8fec55ca59cac3c99cd6aa0d2490f0ba33d64c0c |
|
MD5 | 78c8bc804f9ff279a650251560a49fc1 |
|
BLAKE2b-256 | 12016672102939c4d969d785f5ff98fbb220d03c32c68904de7767b9e36bfa4c |