From a9de208f0c2f0e2073ec96b4bf28bb18c6295f0d Mon Sep 17 00:00:00 2001 From: Yan Wong Date: Fri, 30 May 2025 08:34:38 +0100 Subject: [PATCH] Add doc note re: mutations per site --- python/tskit/trees.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/tskit/trees.py b/python/tskit/trees.py index 52157d1b5a..c05fd6ca44 100644 --- a/python/tskit/trees.py +++ b/python/tskit/trees.py @@ -5972,6 +5972,10 @@ def mutations_site(self): :ref:`sec_mutation_table_definition` as a numpy array (dtype=np.int32). Equivalent to ``ts.tables.mutations.site`` (but avoiding the full copy of the table data that accessing ``ts.tables`` currently entails). + + .. note:: + To efficently get an array of the number of mutations per site, you + can use ``np.bincount(ts.mutations_site, minlength=ts.num_sites)``. """ return self._mutations_site