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.2.tar.gz
(13.9 kB
view hashes)
Built Distribution
Close
Hashes for pajek_tools-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23db34a40d151da462ccae4376719baef7f7f7f6c76afd0a128ba5328e15ef71 |
|
MD5 | 0119a0ea4992c95531be7771d2470d5e |
|
BLAKE2b-256 | ab42f0cabfb99d2174e445414a71e090e0ef8a904a59cea019ed5f6c14d4ca6d |