Skip to content

Commit

Permalink
Fix:Replace eval expression
Browse files Browse the repository at this point in the history
  • Loading branch information
henrymartin1 committed Apr 20, 2023
1 parent 5f5fabe commit 555bc69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trackintel/preprocessing/positionfixes.py
Expand Up @@ -403,7 +403,7 @@ def _generate_staypoints_sliding_user(
gap_threshold = pd.Timedelta(gap_threshold, unit="minutes")
time_threshold = pd.Timedelta(time_threshold, unit="minutes")
# to numpy as access time of numpy array is faster than pandas Series
gap_times = pd.eval("((df.tracked_at - df.tracked_at.shift(1)) > gap_threshold)").to_numpy()
gap_times = ((df.tracked_at - df.tracked_at.shift(1)) > gap_threshold).to_numpy()

# put x and y into numpy arrays to speed up the access in the for loop (shapely is slow)
x = df[geo_col].x.to_numpy()
Expand Down

0 comments on commit 555bc69

Please sign in to comment.