aboutsummaryrefslogtreecommitdiff
path: root/py/deathtable2.py
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2021-01-10 21:15:58 -0500
committerHolden Rohrer <hr@hrhr.dev>2021-01-10 21:15:58 -0500
commit50ad3052a0b0c2245b6f3f481f12322391737aa5 (patch)
tree30890317d114c876e6c09565b234fa307a103815 /py/deathtable2.py
parent2fb9d493a9c08d1e75e51eee2740fc79ff407717 (diff)
working on new graphs
Diffstat (limited to 'py/deathtable2.py')
-rw-r--r--py/deathtable2.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/py/deathtable2.py b/py/deathtable2.py
new file mode 100644
index 0000000..401d42e
--- /dev/null
+++ b/py/deathtable2.py
@@ -0,0 +1,12 @@
+from statistics import mean
+from data2 import trials, fancy
+
+print('\\tabrule Size & Interruption & Reclusive & Dead & Pits formed &\
+Nearest Neighbor (avg) & Width (avg) & Depth (avg)\\cr\\tabrule')
+
+for trial in trials:
+ print('& '.join(['$'+'\\times'.join([str(el) for el in trial.size])+'$',
+ names[trial.method], str(trial.recl), str(trial.dead),
+ str(len(trial.pits)), '%.2f' % mean(trial.nearest_neighbor()),
+ '%.2f' % mean([pit.diam for pit in trial.pits]),
+ '%.2f' % mean([pit.depth for pit in trial.pits])])+'\\cr\\tabrule')