Concise, readable summaries of network data
Project description
Network Cards
A network card is a three-panel tabular summary of a network dataset:
The first panel provides an overall summary of the network, the second summarizes the structure of the network (size, density, connectivity), and the third panel provides additional meta-information, what metadata are associated with nodes and links, how were the data gathered, and so forth.
Network cards are intended to be concise, readable and flexible, allowing researchers across fields to quickly read and understand studies involving network datasets. We believe that a standard representation is crucial to ensuring that key information associated with network data remains available.
This repository provides templates and a Python package to create, update, and export network cards.
Table of Contents
Example
Network Cards
provides fill-in templates but you can also generate and save a card programmatically.
Here's Python code where we load a network from a file and compute the basic card:
import networkx as nx
import network_cards as nc
G = nx.read_edgelist("karate_club.edgelist")
card = nc.NetworkCard(G)
print(card)
This gives:
Name
Kind Undirected, unweighted
Nodes are
Links are
Considerations
Number of nodes 34
Number of links 78
Degree^1 4.58824 [1, 17]
Clustering 0.571
Connected Yes
Diameter 5
Assortativity (degree) -0.476
Node metadata
Link metadata
Date of creation
Data generating process
Ethics
Funding
Citation
^1: Distributions summarized with average [min, max].
Unfortunately, few of the important definitions, details or meta-information are computable, so
most of the fields outside the structure panel are blank.
Let's use update_*
methods to populate the remaining fields ourselves:
card.update_overall("Name", "Zachary Karate Club")
card.update_overall("Nodes are", "Members of club at US university")
card.update_overall("Links are", "Members consistently interacted outside club")
card.update_overall("Considerations", "Heavily used as an example network")
card.update_metainfo({
"Node metadata": "None",
"Link metadata": "None (original study included eight interaction contexts)",
"Date of creation": "1977",
"Data generating process": "Direct observation of club members during period 1970-72",
"Funding": "None",
"Citation": "Zachary (1977)"
})
We used card.update_overall()
and card.update_metainfo()
to insert entries into the previous card.
Entries can be updated one at a time (like we did when updating the overall panel) or a dictionary can be passed to update multiple entries at once.
Now, print the revised card with print(card)
:
Name Zachary Karate Club
Kind Undirected, unweighted
Nodes are Members of club at US university
Links are Members consistently interacted outside club
Considerations Heavily used as an example network
Number of nodes 34
Number of links 78
Degree^1 4.58824 [1, 17]
Clustering 0.571
Connected Yes
Diameter 5
Assortativity (degree) -0.476
Node metadata None
Link metadata None (original study included eight interaction contexts)
Date of creation 1977
Data generating process Direct observation of club members during period 1970-72
Ethics
Funding None
Citation Zachary (1977)
^1: Distributions summarized with average [min, max].
And we can save to a convenient file format:
card.to_latex("karate-card.tex")
card.to_excel("karate-card.xlsx")
Install
pip install network-cards
Requirements
- Python 3.8+
- Networkx
- Pandas
Citation
If you use a Network Card, please cite our paper:
Bagrow, J., & Ahn, Y. (2022). Network Cards: concise, readable summaries of network data
Here is a bibtex entry (.bib file):
@unpublished{bagrow2022cards,
author = {Bagrow, James and Ahn, Yong-Yeol},
title = {Network Cards: concise, readable summaries of network data},
year = {2022},
}
and a .ris entry (.ris file):
TY - UNPB
AU - Bagrow, James
AU - Ahn, Yong-Yeol
TI - Network Cards: concise, readable summaries of network data
PY - 2022
DA - 2022
ER -
License
BSD-3-Clause © James Bagrow
Project details
Release history Release notifications | RSS feed
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 network-cards-0.99.1.1.tar.gz
.
File metadata
- Download URL: network-cards-0.99.1.1.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2e374b16e1e9ebd5541fde587b5adfcfb69b24073d663e4feadf6fb9f9e9162 |
|
MD5 | 63f2194e80d8dcef35952fdaf8350b96 |
|
BLAKE2b-256 | 5a92a6139275624e7df50ce09c7ce748b6f5a061ee9149796de83fc56faac87d |
File details
Details for the file network_cards-0.99.1.1-py3-none-any.whl
.
File metadata
- Download URL: network_cards-0.99.1.1-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32f20df270542f6b4facd2a846d146ce15cce4a987e6d47a5dec88f200395718 |
|
MD5 | f52bd6e6ec5c4c5c4496ad06fd1c66fd |
|
BLAKE2b-256 | 728076039a254b5761a614cef74b20eeb985485ad40a23ec5c71302381ac400d |