Skip to main content

Tools for converting network data to pajek files

Project description

Pajek Tools

https://img.shields.io/pypi/v/pajek_tools.svg

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.4.tar.gz (14.0 kB view hashes)

Uploaded Source

Built Distribution

pajek_tools-0.1.4-py2.py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page