To select N leaves.
- Pick a leaf at random. Add it to a selected list.
While N < len(selected):
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""2019-04-10 David Pattinson | |
Plot the parameter samples from a MrBayes run. | |
- Run this script in a directory that contains *.p files, or that contains | |
subdirectories (however deep) that contain *.p files. | |
- Any .p files in the same directory will be plotted on the same trace. | |
E.g. if HA.run1.p and HA.run2.p are in the same directory, their traces |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
from itertools import groupby | |
lines = sorted(map(lambda l: l.rstrip(), sys.stdin.readlines())) | |
counts = ((len(list(group)), line) for line, group in groupby(lines)) | |
for count, line in sorted(counts, key=lambda x: x[0]): | |
print("{:7d} {}".format(count, line)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sense_hat import SenseHat | |
from functools import reduce | |
from operator import add | |
import random | |
i = 51, 160, 44 | |
o = 178, 223, 138 | |
rows = 8 | |
cols = 8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def attachX(tree): | |
for node in tree.preorder_node_iter(): | |
if node.parent_node is None: | |
node.x = 0 | |
else: | |
node.x = node.edge.length + node.parent_node.x | |
def attatchYLeaves(tree): | |
for y, node in enumerate(tree.leaf_node_iter()): | |
node.y = y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(geometry) | |
library(plotly) | |
xyz <- c("x", "y", "z") | |
convexHull <- function(group) { | |
# I forget whata he name of the variable containing | |
# the data.frame is, and the name of the column | |
# that contains the groups |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Entity | Code | Year | Life expectancy (Clio-Infra up to 1949; UN Population Division for 1950 to 2015) | |
---|---|---|---|---|
Afghanistan | AFG | 1950 | 27.537001 | |
Afghanistan | AFG | 1951 | 27.809999 | |
Afghanistan | AFG | 1952 | 28.35 | |
Afghanistan | AFG | 1953 | 28.879999 | |
Afghanistan | AFG | 1954 | 29.399 | |
Afghanistan | AFG | 1955 | 29.907 | |
Afghanistan | AFG | 1956 | 30.403999 | |
Afghanistan | AFG | 1957 | 30.891001 | |
Afghanistan | AFG | 1958 | 31.367001 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.