Private
Public Access
1
0

filter error

This commit is contained in:
2024-06-19 16:27:43 +02:00
parent f2eafbf3e9
commit ffc8c65ed9

View File

@@ -2204,26 +2204,27 @@ def dataplep(rowdatadf, id=0, inboard=0.88, forceunit='lbs', bands=True, barchar
if windowsize <= 3: if windowsize <= 3:
windowsize = 5 windowsize = 5
try: try:
df.with_columns( df = df.with_columns(
(pl.col(" Cadence (stokes/min)").map_batches(lambda x: savgol_filter(x.to_numpy(), windowsize, 3)).explode() (pl.col(" Cadence (stokes/min)").map_batches(lambda x: savgol_filter(x.to_numpy(), windowsize, 3)).explode()
).alias(" Cadence (stokes/min)")) ).alias(" Cadence (stokes/min)"))
except ComputeError: except ComputeError as e:
pass pass
try: try:
df.with_columns( df = df.with_columns(
(pl.col(" DriveLength (meters)").map_batches(lambda x: savgol_filter(x.to_numpy(), windowsize, 3)).explode() (pl.col(" DriveLength (meters)").map_batches(lambda x: savgol_filter(x.to_numpy(), windowsize, 3)).explode()
).alias(" DriveLength (meters)")) ).alias(" DriveLength (meters)"))
except ComputeError: except ComputeError:
pass pass
try: try:
df.with_columns( df = df.with_columns(
(pl.col(" HRCur (bpm)").map_batches(lambda x: savgol_filter(x.to_numpy(), windowsize, 3)).explode() (pl.col(" HRCur (bpm)").map_batches(lambda x: savgol_filter(x.to_numpy(), windowsize, 3)).explode()
).alias(" HRCur (bpm)")) ).alias(" HRCur (bpm)"))
except ComputeError: except ComputeError:
pass pass
try: try:
df.with_columns((pl.col("forceratio").map_batches(lambda x: savgol_filter(x.to_numpy(), windowsize, 3)).explode()).alias("forceratio")) df = df.with_columns((pl.col("forceratio").map_batches(lambda x: savgol_filter(x.to_numpy(), windowsize, 3)).explode()).alias("forceratio"))
except ComputeError: except ComputeError:
pass pass