Skip to content

Commit 8caf830

Browse files
hyanwongjeromekelleher
authored andcommitted
Add doc note re: mutations per site
1 parent 9d2ff8e commit 8caf830

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/tskit/trees.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5972,6 +5972,10 @@ def mutations_site(self):
59725972
:ref:`sec_mutation_table_definition` as a numpy array (dtype=np.int32).
59735973
Equivalent to ``ts.tables.mutations.site`` (but avoiding the full copy
59745974
of the table data that accessing ``ts.tables`` currently entails).
5975+
5976+
.. note::
5977+
To efficently get an array of the number of mutations per site, you
5978+
can use ``np.bincount(ts.mutations_site, minlength=ts.num_sites)``.
59755979
"""
59765980
return self._mutations_site
59775981

0 commit comments

Comments
 (0)