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

Compatibility with Pandas >= 2.0 #925

Open
lecramex opened this issue Mar 11, 2024 · 4 comments
Open

Compatibility with Pandas >= 2.0 #925

lecramex opened this issue Mar 11, 2024 · 4 comments
Assignees

Comments

@lecramex
Copy link

Hello,

While working with neuralforecast 1.6.4 and pandas > 2.0 I found the error when calling neuralforecast.utils.augment_calendar_df :

'DatetimeIndex' object has no attribute 'week'.

This is because this functions calls:

return (index.week - 1) / 52.0 - 0.5

Which is using index.week, but DatetimeIndex.week has been deprecated since pandas 1.1.0, to solve this you should replace it by:

        return (index.isocalendar().week  - 1) / 52.0 - 0.5
@elephaint
Copy link
Contributor

Thanks, good point. I think it should be index.dt.isocalendar().week, i.e. first need to access the .dt attribute. I'll have a pass through our code and see if there are other such occurences, so we can fix it everywhere.

@elephaint elephaint self-assigned this Mar 11, 2024
@lecramex
Copy link
Author

Thanks @elephaint do you have any idea when this will available in a release ?

@jmoralez
Copy link
Member

This may be a good opportunity to implement this in utilsforecast and add support for polars as well.

@elephaint
Copy link
Contributor

Thanks @elephaint do you have any idea when this will available in a release ?

Not yet

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

3 participants