From a5aa6d65f56e435f30f9a471e48d779585bcf5ee Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sat, 20 Jan 2018 10:04:32 +0100 Subject: [PATCH] bug fix flex chart --- rowers/dataprep.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rowers/dataprep.py b/rowers/dataprep.py index ae83c7c2..032d51b9 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -2059,7 +2059,11 @@ def dataprep(rowdatadf, id=0, bands=True, barchart=True, otwpower=True, if barchart: # time increments for bar chart time_increments = rowdatadf.ix[:, ' ElapsedTime (sec)'].diff() - time_increments.ix[0] = time_increments.ix[1] + try: + time_increments.ix[0] = time_increments.ix[1] + except KeyError: + time_increments.ix[0] = 1. + time_increments = 0.5 * time_increments + 0.5 * np.abs(time_increments) x_right = (t2 + time_increments.apply(lambda x: timedeltaconv(x)))