summaryrefslogtreecommitdiffstats
path: root/fiz/vaje/10/tab.py
diff options
context:
space:
mode:
Diffstat (limited to 'fiz/vaje/10/tab.py')
-rwxr-xr-xfiz/vaje/10/tab.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/fiz/vaje/10/tab.py b/fiz/vaje/10/tab.py
index cb70e75..c5c24db 100755
--- a/fiz/vaje/10/tab.py
+++ b/fiz/vaje/10/tab.py
@@ -3,10 +3,12 @@ import pandas
import sys
from math import pi
l = 23.5
-b=pandas.read_csv("/dev/stdin", sep="\t")
-b.index.name = "idx"
-b["x"] = (b["y"]/13*l)
-b["omega"] = ((9.81/b["l"])**(1/2))
-b["f"] = (b["omega"]*0.5/pi)
-b = b.astype(float).round(6);
-b.to_csv("/dev/stdout", sep=sys.argv[1][0]);
+df = pandas.read_csv("podatki.tsv", sep="\t")
+df.index.name = "idx"
+df["x"] = (df["y"]/13*l)
+df["omega"] = ((9.81/df["l"])**(1/2))
+df["f"] = (df["omega"]*0.5/pi)
+df = df.astype(float).round(6);
+data = df.values
+if __name__ == "__main__":
+ df.to_csv("/dev/stdout", sep=",");