summaryrefslogtreecommitdiffstats
path: root/fiz/vaje/10/tab.py
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2023-03-30 10:01:52 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2023-03-30 10:01:52 +0200
commitdbfe733096c3c3b06be10ea1b045bb1094e62c8d (patch)
treeb7a8256ec8b7baea9c08d1833e97a759461b7f23 /fiz/vaje/10/tab.py
parentpredst rn (diff)
downloadsola-gimb-4-dbfe733096c3c3b06be10ea1b045bb1094e62c8d.tar
sola-gimb-4-dbfe733096c3c3b06be10ea1b045bb1094e62c8d.tar.gz
sola-gimb-4-dbfe733096c3c3b06be10ea1b045bb1094e62c8d.tar.bz2
sola-gimb-4-dbfe733096c3c3b06be10ea1b045bb1094e62c8d.tar.lz
sola-gimb-4-dbfe733096c3c3b06be10ea1b045bb1094e62c8d.tar.xz
sola-gimb-4-dbfe733096c3c3b06be10ea1b045bb1094e62c8d.tar.zst
sola-gimb-4-dbfe733096c3c3b06be10ea1b045bb1094e62c8d.zip
Diffstat (limited to '')
-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=",");