Skip to main content

Concise, readable summaries of network data

Project description

Network Cards

A network card is a three-panel tabular summary of a network dataset:

Example network card for the Zachary Karate Club

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.

Interested in more? Check out the paper.

Table of Contents

Install

pip install network-cards

Requirements

  • Python 3.8+
  • Networkx
  • Pandas

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")

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

network_cards-0.99.2.2.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

network_cards-0.99.2.2-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file network_cards-0.99.2.2.tar.gz.

File metadata

  • Download URL: network_cards-0.99.2.2.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for network_cards-0.99.2.2.tar.gz
Algorithm Hash digest
SHA256 9806ce14e9fd34b45d13ea2130083dec9b97738f4333b7f7b3dcbe7227507461
MD5 47d09fe7ecfaefddd11d42d5f1598842
BLAKE2b-256 198100704829bc9b72fe9aaf843c517617661cdccffcc4d5bab2988a37c95d35

See more details on using hashes here.

File details

Details for the file network_cards-0.99.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for network_cards-0.99.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dd93437727b13810f5c255cf338bd80d7855bc99a3ae55cd1a2abe4dca7a23f8
MD5 1ecc0aa8328d237251d278ee11633859
BLAKE2b-256 de1313342a6740ab31f75fa94f382cf7ffe4caa73376a08ad9ef1f793d61df88

See more details on using hashes here.

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