blob: 0bc48c57b13052c8341cb27d754285a0a2d1ea13 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#!/usr/bin/python3
import pandas
import sys
import math
b=pandas.read_csv("/dev/stdin", sep="\t")
b.index.name = "idx"
b["a"] = (b["a+b"]-b["b"])
b["1/a"] = (1/b["a"])
b["1/b"] = (1/b["b"])
b["f"] = (1/(b["1/a"]+b["1/b"]))
b["fodst"] = (abs(b["f"] - b.mean()["f"]))
b = b.astype(float).round(6);
b.to_csv("/dev/stdout", sep=sys.argv[1][0]);
print(f"f = {b.mean()['f']} \pm {b.max()['fodst']} = {b.mean()['f']} (1 \pm {b.max()['fodst']/b.mean()['f']})", file=sys.stderr)
|