diff scripts/process.py @ 998:933670761a57

updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Sun, 27 May 2018 23:22:48 -0400
parents dc0be55e2bf5
children 75af46516b2b
line wrap: on
line diff
--- a/scripts/process.py	Fri May 25 18:15:18 2018 -0400
+++ b/scripts/process.py	Sun May 27 23:22:48 2018 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 
 import sys, argparse
 from pathlib2 import Path
@@ -86,7 +86,7 @@
     for speeds, name in zip([medianSpeeds, speeds85], ['Median', '85th Centile']):
         plt.ioff()
         plt.figure()
-        plt.boxplot(speeds.values(), labels = [session.query(Site).get(siteId).name for siteId in speeds])
+        plt.boxplot(list(speeds.values()), labels = [session.query(Site).get(siteId).name for siteId in speeds])
         plt.ylabel(name+' Speeds (km/h)')
         plt.savefig(name.lower()+'-speeds.png', dpi=150)
         plt.close()