Isocalender

Hello,

On my computer this code works, but on share.streamlit.io it gives me an error.

df['date'].dt.isocalendar().week

AttributeError: ‘DatetimeProperties’ object has no attribute ‘isocalendar’

If I leave it out, on my computer this warning is shown
FutureWarning: Series.dt.weekofyear and Series.dt.week have been deprecated. Please use Series.dt.isocalendar().week instead.

Hi @rcsmit, can you post a link to your code?

  df['weeknr']  =  df['date'].dt.isocalendar().week
  df['yearnr']  =  df['date'].dt.isocalendar().year
  df['weekalt']   = (df['date'].dt.isocalendar().year.astype(str) + "-"+
                      df['date'].dt.isocalendar().week.astype(str))

Here you are

I actually meant the whole repo, so I could try to deploy it locally as well as on Streamlit sharing.

Sorry, here you are :slight_smile:

https://share.streamlit.io/rcsmit/covidcases/main/covid_dashboard_rcsmit.py

The sharing is at
https://share.streamlit.io/rcsmit/covidcases/main/covid_dashboard_rcsmit.py

(but I had to remove the isocalender, so the weeknrs are not shown as I want to (2021-01))