History of nokia_investors
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 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/nokia_investors/__init__.py b/entries/nokia_investors/__init__.py
index b72308d..55fa1e1 100644
--- a/entries/nokia_investors/__init__.py
+++ b/entries/nokia_investors/__init__.py
@@ -38,7 +38,7 @@ tags = ['Economic', 'Weighted', 'Temporal', 'Multigraph', 'Metadata']
url = 'https://doi.org/10.5061/dryad.5b8n621'
citation = [('S. Ranganathan, M. Kivelä, J. Kanniainen, "Dynamics of investor spanning trees around dot-com bubble." PLOS ONE 13(6), e0198807 (2018)', 'https://doi.org/10.1371/journal.pone.0198807'),
('S. Ranganathan, M. Kivelä, J. Kanniainen, "Data from: Dynamics of investor spanning trees around dot-com bubble." Dryad, dataset (2018)', 'https://doi.org/10.5061/dryad.5b8n621')]
-icon_hash = '5e23e26878691ca4060b62c1'
+date_added = '2026-10-25'
upstream_license = ('Creative Commons CC0 1.0 Universal', 'https://creativecommons.org/publicdomain/zero/1.0/')
# Zip file of the dataset version (the individual file downloads require an
# access token), which contains one zip file per investor category
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) 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/nokia_investors/__init__.py b/entries/nokia_investors/__init__.py
index 9842047..b72308d 100644
--- a/entries/nokia_investors/__init__.py
+++ b/entries/nokia_investors/__init__.py
@@ -31,8 +31,9 @@ description = """Temporal correlation networks among the investors that traded t
The networks have the following properties:
-- Nodes: `investor_id`, the anonymized identifier of the investor.
-- Edges: `weight`, the Pearson correlation coefficient between the daily net volumes of the two investors in the window; `time`, the date that labels the window in the source data (as a Unix timestamp), which appears to be the first trading day of the window, since it ranges from January 1998 to June 2002."""
+- (Node) `investor_id`: the anonymized identifier of the investor.
+- (Edge) `weight`: the Pearson correlation coefficient between the daily net volumes of the two investors in the window.
+- (Edge) `time`: the date that labels the window in the source data (as a Unix timestamp), which appears to be the first trading day of the window, since it ranges from January 1998 to June 2002."""
tags = ['Economic', 'Weighted', 'Temporal', 'Multigraph', 'Metadata']
url = 'https://doi.org/10.5061/dryad.5b8n621'
citation = [('S. Ranganathan, M. Kivelä, J. Kanniainen, "Dynamics of investor spanning trees around dot-com bubble." PLOS ONE 13(6), e0198807 (2018)', 'https://doi.org/10.1371/journal.pone.0198807'),
[entries] Remove unneeded code from the entries 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/nokia_investors/__init__.py b/entries/nokia_investors/__init__.py
index 319ee1a..9842047 100644
--- a/entries/nokia_investors/__init__.py
+++ b/entries/nokia_investors/__init__.py
@@ -60,7 +60,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: nokia_investors b3bda53
diff --git a/entries/nokia_investors/__init__.py b/entries/nokia_investors/__init__.py
new file mode 100644
index 0000000..319ee1a
--- /dev/null
+++ b/entries/nokia_investors/__init__.py
@@ -0,0 +1,101 @@
+#! /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 *
+import io
+import zipfile
+import datetime
+
+title = "Nokia investor trading correlations (1998-2002)"
+description = """Temporal correlation networks among the investors that traded the Nokia stock on the Helsinki stock exchange between January 1998 and December 2002, from Ranganathan et al. The data come from the central register of shareholdings of the Finnish central securities depository (Euroclear Finland), which records the daily trades of all Finnish households and institutions (foreign investors are excluded). For each investor, the daily net volume (the number of shares bought minus the number of shares sold, averaged over a week) was computed, and the Pearson correlation of the net volumes of each pair of investors was measured over six-month windows of 126 trading days, shifted by one month (21 trading days), giving 54 windows. In each window, only the investors that traded on at least 20 days are included, and all pairs of them are connected, i.e. the network of each window is a complete graph. The analysis was done separately for three categories of investors, which correspond to the three networks below; there are no edges between investors of different categories. The edges of all windows are combined into a single multigraph, with the window given as an edge property. Investor identifiers are anonymized.
+
+- `households`: Finnish household investors (54 windows).
+- `non_financial`: non-financial institutions (54 windows).
+- `financial`: financial institutions (only 27 of the 54 windows are included in the distributed data).
+
+The networks have the following properties:
+
+- Nodes: `investor_id`, the anonymized identifier of the investor.
+- Edges: `weight`, the Pearson correlation coefficient between the daily net volumes of the two investors in the window; `time`, the date that labels the window in the source data (as a Unix timestamp), which appears to be the first trading day of the window, since it ranges from January 1998 to June 2002."""
+tags = ['Economic', 'Weighted', 'Temporal', 'Multigraph', 'Metadata']
+url = 'https://doi.org/10.5061/dryad.5b8n621'
+citation = [('S. Ranganathan, M. Kivelä, J. Kanniainen, "Dynamics of investor spanning trees around dot-com bubble." PLOS ONE 13(6), e0198807 (2018)', 'https://doi.org/10.1371/journal.pone.0198807'),
+ ('S. Ranganathan, M. Kivelä, J. Kanniainen, "Data from: Dynamics of investor spanning trees around dot-com bubble." Dryad, dataset (2018)', 'https://doi.org/10.5061/dryad.5b8n621')]
+icon_hash = '5e23e26878691ca4060b62c1'
+upstream_license = ('Creative Commons CC0 1.0 Universal', 'https://creativecommons.org/publicdomain/zero/1.0/')
+# Zip file of the dataset version (the individual file downloads require an
+# access token), which contains one zip file per investor category
+upstream_prefix = None
+archive_url = 'https://datadryad.org/api/v2/versions/22403/download'
+files = [(('dryad_5b8n621.zip:households_part1.zip',
+ 'dryad_5b8n621.zip:households_part2.zip'), 'households', None),
+ ('dryad_5b8n621.zip:non-financial institution.zip', 'non_financial', None),
+ ('dryad_5b8n621.zip:financial institution.zip', 'financial', None)]
+
+MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
+ 'Oct', 'Nov', 'Dec']
+
+def fetch_upstream(force=False):
+ # (the content of the archive is checked to be a zip file)
+ return fetch_archived_files(__name__.split(".")[-1],
+ {"dryad_5b8n621.zip": archive_url}, 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
+ if isinstance(fnames, str):
+ fnames = [fnames]
+ edges = []
+ times = []
+ for fn in fnames:
+ with open_upstream_file(name, fn, "rb") as f:
+ zf = zipfile.ZipFile(io.BytesIO(f.read()))
+ for zname in sorted(zf.namelist()):
+ if not zname.endswith(".txt"):
+ continue
+ # Files named e.g. "households_01-Dec-1999.txt", with lines
+ # "investor,investor,correlation"
+ # (month names parsed explicitly, independently of the locale)
+ d, m, y = zname[-15:-4].split("-")
+ date = datetime.datetime(int(y), MONTHS.index(m) + 1, int(d),
+ tzinfo=datetime.timezone.utc)
+ a = numpy.loadtxt(io.BytesIO(zf.read(zname)), delimiter=",",
+ ndmin=2)
+ edges.append(a)
+ times.append(numpy.full(len(a), int(date.timestamp()),
+ dtype="int64"))
+ edges = numpy.concatenate(edges)
+ times = numpy.concatenate(times)
+ ids, idx = numpy.unique(edges[:, :2].astype("int64"),
+ return_inverse=True)
+ idx = idx.reshape(-1, 2)
+ g = Graph(directed=False)
+ g.add_vertex(len(ids))
+ g.vp.investor_id = g.new_vp("int", vals=ids)
+ g.ep.weight = g.new_ep("double")
+ g.ep.time = g.new_ep("int64_t")
+ g.add_edge_list(numpy.column_stack((idx, edges[:, 2], times)),
+ eprops=[g.ep.weight, g.ep.time])
+ yield alt, g