Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity processing #34

Closed
CinGiu opened this issue Jul 25, 2023 · 2 comments
Closed

Activity processing #34

CinGiu opened this issue Jul 25, 2023 · 2 comments

Comments

@CinGiu
Copy link

CinGiu commented Jul 25, 2023

I can't plot the calendar with activity data exported

/usr/local/lib/python3.11/site-packages/stravavis/plot_calendar.py:11: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
  activities['Activity Date'] = pd.to_datetime(activities['Activity Date'])
Traceback (most recent call last):
  File "/Users/giulio/Documents/workspace/strava-plot/main.py", line 11, in <module>
    main()
  File "/Users/giulio/Documents/workspace/strava-plot/main.py", line 7, in main
    plot_calendar(activities, year_min=2015, year_max=2022, max_dist=80,
  File "/usr/local/lib/python3.11/site-packages/stravavis/plot_calendar.py", line 24, in plot_calendar
    fig, ax = calmap.calendarplot(
              ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/calmap/__init__.py", line 403, in calendarplot
    yearplot(by_day, year=year, how=None, ax=ax, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/calmap/__init__.py", line 202, in yearplot
    plot_data = by_day.pivot("day", "week", "data").values[::-1]
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DataFrame.pivot() takes 1 positional argument but 4 were given

the code

from stravavis.process_activities import process_activities
from stravavis.plot_calendar import plot_calendar

def main():
    activities = process_activities("./export/activities.csv")

    plot_calendar(activities, year_min=2015, year_max=2022, max_dist=80,
                fig_height=9, fig_width=15, output_file="calendar.png")

if __name__ == "__main__":
    main()
@hugovk
Copy link
Collaborator

hugovk commented Jul 25, 2023

This is because a dependency doesn't yet support Pandas 2:

Can you install pandas < 2 and try again?

I'll then make a new release that includes #32 to require pandas < 2.

@CinGiu
Copy link
Author

CinGiu commented Jul 25, 2023

it worked! thanks!

@CinGiu CinGiu closed this as completed Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants