From a80c523c3bd8f5499d238ec1b0c2553642e461bc Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Thu, 31 Oct 2024 09:06:37 +0100 Subject: [PATCH] changes --- rowers/dataroutines.py | 6 +++++- rowers/tests/testdata/testdata.tcx.gz | Bin 4000 -> 4000 bytes rowers/views/analysisviews.py | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rowers/dataroutines.py b/rowers/dataroutines.py index 6dc3268b..422226bd 100644 --- a/rowers/dataroutines.py +++ b/rowers/dataroutines.py @@ -37,6 +37,7 @@ from polars.exceptions import ( ColumnNotFoundError, SchemaError, ComputeError, InvalidOperationError, ShapeError ) +from pandas.errors import IntCastingNaNError from rowingdata import ( KinoMapParser, @@ -257,7 +258,10 @@ def get_video_data(w, groups=['basic'], mode='water'): df2 = pd.concat([df2, coordinates], axis=1) latitude = df2['latitude'] longitude = df2['longitude'] - boatspeed = (100*df2['velo'].fillna(method='ffill').fillna(method='bfill')).astype(int)/100. + try: + boatspeed = (100*df2['velo'].fillna(method='ffill').fillna(method='bfill')).astype(int)/100. + except IntCastingNaNError: + boatspeed = 0.0*df2['longitude'] # bundle data data = { 'boatspeed': boatspeed.values.tolist(), diff --git a/rowers/tests/testdata/testdata.tcx.gz b/rowers/tests/testdata/testdata.tcx.gz index 654adcaedc233e73eae89b6b82380d30b627db18..96de089261eaba1ffcf28004d7b41f4b18171ba8 100644 GIT binary patch delta 36 scmZ1=zd)W{zMF%?=!(on_LY2WcZHOW+viT+#`lP0-?fy6BMpoU0OF?&SpWb4 delta 36 scmZ1=zd)W{zMF&NguCEI_LY2W^=@&yl+z|}<9o#6D{)cfNCP7S0NC&h8vp