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.

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


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

Uploaded Source

Built Distribution

network_cards-0.99.1.1-py3-none-any.whl (13.4 kB view hashes)

Uploaded 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