logo Netzschleuder network catalog, repository, and centrifuge

History of groningen_freshmen

The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.

[entries] Add the date when each entry was added, and remove icon_hash by Tiago de Paula Peixoto beff7c9
The dates are those of the commits that first added the entries' files
(2020-08-11 for the entries of the initial commit); renamed entries keep
the date of their first name.

Changed: none
diff --git a/entries/groningen_freshmen/__init__.py b/entries/groningen_freshmen/__init__.py
index 06eec75..256b0d8 100644
--- a/entries/groningen_freshmen/__init__.py
+++ b/entries/groningen_freshmen/__init__.py
@@ -35,7 +35,7 @@ The networks have the following properties:
 tags = ['Social', 'Offline', 'Weighted', 'Metadata', 'Temporal']
 url = 'https://www.stats.ox.ac.uk/~snijders/siena/vDuijn_data.htm'
 citation = [('M. A. J. van Duijn, E. P. H. Zeggelink, M. Huisman, F. N. Stokman, F. W. Wasseur, "Evolution of sociology freshmen into a friendship network." Journal of Mathematical Sociology 27(2-3), 153-191 (2003)', 'https://doi.org/10.1080/00222500305889')]
-icon_hash = '5944a7164ed8f1bb6022a495'
+date_added = '2026-10-25'
 upstream_license = None
 upstream_prefix = 'https://www.stats.ox.ac.uk/~snijders/siena'
 files = [((f'DataMarijtje.zip:t{t}.dat', 'DataMarijtje.zip:cov1.dat'), f't{t}', None)
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) by Tiago de Paula Peixoto bc3dbbd
The lists of properties at the end of the descriptions marked edge
properties with "Edge" but left node properties unmarked, or grouped
them in "Nodes: `a`, ...; `b`, ..." items, so the kind of a property
was often unclear. Every item now starts with (Node), (Edge) or (Graph),
followed by the property names, a colon and the explanation, one item
per property or group of properties; qualifications (kinds of nodes,
networks) follow the names in parentheses. Properties that were only
named got a short explanation, and a few items that named the wrong
kind of property were corrected.
diff --git a/entries/groningen_freshmen/__init__.py b/entries/groningen_freshmen/__init__.py
index aca94d9..06eec75 100644
--- a/entries/groningen_freshmen/__init__.py
+++ b/entries/groningen_freshmen/__init__.py
@@ -26,8 +26,12 @@ A directed edge (i, j) indicates that student i rated their relationship with st
 
 The networks have the following properties:
 
-- Nodes: `responded`, whether the student answered the questionnaire at this time point; `gender` (1: male, 2: female); `program`, the study program (1: regular 4-year program, 2: 2-year program, followed by older students after higher vocational training); `smoking` (0: no, 2: yes, at parties, 3: 1-3 cigarettes per day, 4: 4-10 per day, 5: more than 10 per day, 9: missing); `soft_drugs`, use of soft drugs (1: no, 2: less than once a month, 3: 1-3 times per month, 4: 1-3 times per week, 5: more than 3 times per week). The node attributes were measured at the first time point.
-- Edges: `relation`, the rated relationship (1: best friendship, 2: friendship, 3: friendly relationship, 4: neutral relationship, 5: troubled relationship)."""
+- (Node) `responded`: whether the student answered the questionnaire at this time point.
+- (Node) `gender` (1: male, 2: female).
+- (Node) `program`: the study program (1: regular 4-year program, 2: 2-year program, followed by older students after higher vocational training).
+- (Node) `smoking` (0: no, 2: yes, at parties, 3: 1-3 cigarettes per day, 4: 4-10 per day, 5: more than 10 per day, 9: missing).
+- (Node) `soft_drugs`: use of soft drugs (1: no, 2: less than once a month, 3: 1-3 times per month, 4: 1-3 times per week, 5: more than 3 times per week). The node attributes were measured at the first time point.
+- (Edge) `relation`: the rated relationship (1: best friendship, 2: friendship, 3: friendly relationship, 4: neutral relationship, 5: troubled relationship)."""
 tags = ['Social', 'Offline', 'Weighted', 'Metadata', 'Temporal']
 url = 'https://www.stats.ox.ac.uk/~snijders/siena/vDuijn_data.htm'
 citation = [('M. A. J. van Duijn, E. P. H. Zeggelink, M. Huisman, F. N. Stokman, F. W. Wasseur, "Evolution of sociology freshmen into a friendship network." Journal of Mathematical Sociology 27(2-3), 153-191 (2003)', 'https://doi.org/10.1080/00222500305889')]
[entries] Remove unneeded code from the entries by Tiago de Paula Peixoto 2c69f19
Unneeded "global files" statements, unused imports and variables,
f-strings without placeholders, duplicate keys in foodweb_little_rock
(keeping the order and the values used), and the second definition of
get_lines() in twitter_higgs. Nothing changes in the networks or
descriptions.

Changed: none
diff --git a/entries/groningen_freshmen/__init__.py b/entries/groningen_freshmen/__init__.py
index 526b5bf..aca94d9 100644
--- a/entries/groningen_freshmen/__init__.py
+++ b/entries/groningen_freshmen/__init__.py
@@ -45,7 +45,6 @@ def fetch_upstream(force=False):
 @coerce_props()
 @annotate()
 def parse(alts=None):
-    global files
     name = __name__.split(".")[-1]
     for fnames, alt, fmt in files:
         if alts is not None and alt not in alts:
[entries] New entry: groningen_freshmen by Tiago de Paula Peixoto 24ead1a
diff --git a/entries/groningen_freshmen/__init__.py b/entries/groningen_freshmen/__init__.py
new file mode 100644
index 0000000..526b5bf
--- /dev/null
+++ b/entries/groningen_freshmen/__init__.py
@@ -0,0 +1,70 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+from .. import *
+
+title = "Groningen sociology freshmen friendships (1996-1997)"
+description = """Friendship ratings among the freshman cohort majoring in sociology at the University of Groningen (the Netherlands) in 1996-1997, collected by G. van de Bunt, M. van Duijn, F. Stokman and E. Zeggelink, and distributed by T. Snijders with the SIENA software. Except for a few acquaintances from a former school, the students did not know each other at the first measurement, which took place at the start of the academic year during an introduction period on the island of Schiermonnikoog. The networks were measured at five time points, 0, 3, 6, 13 and 35 weeks after the start (`t1` to `t5`); the number of responding students was 38, 25, 28, 18 and 18, respectively, part of the decrease being due to dropout. According to the authors, the data for the last time point are not fully reliable, since some of the questionnaires were handed in before and some after an unexpected event that had a great impact on the students. The data were collected in a similar way as the earlier van de Bunt data of 1994-1995.
+
+A directed edge (i, j) indicates that student i rated their relationship with student j as one of the categories below (unknown persons, and missing answers, do not give rise to edges). Students who did not answer the questionnaire at a given time have no outgoing edges.
+
+The networks have the following properties:
+
+- Nodes: `responded`, whether the student answered the questionnaire at this time point; `gender` (1: male, 2: female); `program`, the study program (1: regular 4-year program, 2: 2-year program, followed by older students after higher vocational training); `smoking` (0: no, 2: yes, at parties, 3: 1-3 cigarettes per day, 4: 4-10 per day, 5: more than 10 per day, 9: missing); `soft_drugs`, use of soft drugs (1: no, 2: less than once a month, 3: 1-3 times per month, 4: 1-3 times per week, 5: more than 3 times per week). The node attributes were measured at the first time point.
+- Edges: `relation`, the rated relationship (1: best friendship, 2: friendship, 3: friendly relationship, 4: neutral relationship, 5: troubled relationship)."""
+tags = ['Social', 'Offline', 'Weighted', 'Metadata', 'Temporal']
+url = 'https://www.stats.ox.ac.uk/~snijders/siena/vDuijn_data.htm'
+citation = [('M. A. J. van Duijn, E. P. H. Zeggelink, M. Huisman, F. N. Stokman, F. W. Wasseur, "Evolution of sociology freshmen into a friendship network." Journal of Mathematical Sociology 27(2-3), 153-191 (2003)', 'https://doi.org/10.1080/00222500305889')]
+icon_hash = '5944a7164ed8f1bb6022a495'
+upstream_license = None
+upstream_prefix = 'https://www.stats.ox.ac.uk/~snijders/siena'
+files = [((f'DataMarijtje.zip:t{t}.dat', 'DataMarijtje.zip:cov1.dat'), f't{t}', None)
+         for t in range(1, 6)]
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    global files
+    name = __name__.split(".")[-1]
+    for fnames, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        with ExitStack() as stack:
+            fs = [stack.enter_context(open_upstream_file(name, fn, "r"))
+                  for fn in fnames]
+            A = numpy.loadtxt(fs[0], dtype="int")
+            cov = numpy.array([[int(x) for x in line.split()]
+                               for line in fs[1] if line.strip()])
+        numpy.fill_diagonal(A, 0)
+        g = Graph(directed=True)
+        g.add_vertex(A.shape[0])
+        # 9: actor non-response; 6: item non-response; 0: unknown person
+        g.vp.responded = g.new_vp("bool", vals=[not (r == 9).any() for r in A])
+        for i, p in enumerate(["gender", "program", "smoking", "soft_drugs"]):
+            g.vp[p] = g.new_vp("int", vals=cov[:, i + 1])
+        g.ep.relation = g.new_ep("int")
+        A[A > 5] = 0
+        i, j = A.nonzero()
+        g.add_edge_list(numpy.array([i, j, A[i, j]]).T, eprops=[g.ep.relation])
+        yield alt, g