diff options
Diffstat (limited to 'fiz/vaje/9/tab.py')
-rwxr-xr-x | fiz/vaje/9/tab.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fiz/vaje/9/tab.py b/fiz/vaje/9/tab.py new file mode 100755 index 0000000..0bc48c5 --- /dev/null +++ b/fiz/vaje/9/tab.py @@ -0,0 +1,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) |