8000 Future Warning regarding DateTime_Functions - series.dt.weekofyear · Issue #153 · antoinecarme/pyaf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Future Warning regarding DateTime_Functions - series.dt.weekofyear #153
Closed
@TomKetOS

Description

@TomKetOS

Hello Antoinecarme,
thanks a lot for all your work done here.
I'm very new in python and programming at all, but thanks to your dokumentation i could start working with forecasting.

I got a FutureWaring as follows:

D:\Python\WPy64-3810\python-3.8.1.amd64\lib\site-packages\pyaf\TS\DateTime_Functions.py:50: FutureWarning:

Series.dt.weekofyear and Series.dt.week have been deprecated. Please use Series.dt.isocalendar().week instead.

I try to modifiy but that seem to make the problem bigger:

class cDateTime_Helper:

def __init__(self):
    pass


def get_week_of_month(self, series):
    lFirstDayOfMonth = series - pd.to_timedelta(series.dt.day - 1, unit='D')
    return series.dt.weekofyear - lFirstDayOfMonth.dt.weekofyear + 1
    #return series.dt.isocalendar().week - lFirstDayOfMonth.dt.isocalendar() + 1

thanks a lot
Thomas

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0