Skip to content

Commit

Permalink
Merge pull request #49 from hugovk/fix-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Oct 20, 2024
2 parents 6cff6ab + a904aaa commit b7bdfc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/stravavis/plot_dumbbell.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ def plot_dumbbell(

# Get activity start and end times
activities["start"] = activities["Activity Date"]
activities["duration"] = 0
for i in range(len(activities)):
activities["duration"][i] = pd.Timedelta(
activities["Elapsed Time"][i], unit="s"
)
activities["duration"] = pd.to_timedelta(activities["Elapsed Time"], unit="s")
activities["end"] = pd.to_datetime(activities["start"] + activities["duration"])

# Remove activities outside the year_min -> year_max window
Expand Down
4 changes: 2 additions & 2 deletions src/stravavis/plot_landscape.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def plot_landscape(df, output_file="landscape.png"):
processed = []

for activity in track(activities, "Processing tracks"):
df_i = df[df["name"] == activity]
df_i["dist_norm"] = (df_i["dist"] - df_i["dist"].min()) / (
df_i = df[df["name"] == activity].copy()
df_i.loc[:, "dist_norm"] = (df_i["dist"] - df_i["dist"].min()) / (
df_i["dist"].max() - df_i["dist"].min()
)
processed.append(df_i)
Expand Down

0 comments on commit b7bdfc3

Please sign in to comment.