From 739203eeb54805648048bf3588e07109667d923c Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 2 Apr 2024 07:46:54 +0200 Subject: [PATCH] fix --- rowers/interactiveplots.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index fe4dd91a..1e14f767 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -3193,9 +3193,12 @@ def interactive_cum_flex_chart2(theworkouts, promember=0, x1 = datadf['x1'] y1 = datadf['y1'] - popt, pcov = optimize.curve_fit(func, x1, y1) - ytrend = func(x1, popt[0], popt[1]) - datadf['ytrend'] = ytrend + try: + popt, pcov = optimize.curve_fit(func, x1, y1) + ytrend = func(x1, popt[0], popt[1]) + datadf['ytrend'] = ytrend + except TypeError: + datadf['ytrend'] = y1 data_dict = datadf.to_dict("records")