Help about negative acceleration rows

Hi,
I didn’t understand what i exactly should do:

“we can limit ourself to positive acceleration only by clipping to 0 the negative acceleration values (they would correspond to some power created by the braking that we are not modeling here).”

It means:

  • I should drop the negative acceleration rows?
    or
  • I should set ‘0’ where the acceleration is negative?

Thanks!

Hi, Personally I applied the second solution
dt_pw[‘acceleration’]=dt_pw[‘acceleration’].apply(lambda x: 0 if x<=0 else x)

Bye

1 Like

In fact they are giving you a clue to how to treat negative acceleration.
You can do as @blooridian did or use pandas.DataFrame.clip — pandas 1.3.0 documentation.
For example:

new_data_matrix["acceleration"]=new_data_matrix["acceleration"].clip(lower=0)
1 Like