Code Monkey home page Code Monkey logo

Comments (4)

benHeid avatar benHeid commented on July 19, 2024

I suppose it fails, since pd.date_range(start="2001-01-01", periods=30, freq="M") is resulting in a date time index with ME periodicities. And MEis no supported Period Alias

pd.date_range(start="2001-01-01", periods=30, freq="M")

DatetimeIndex(['2001-01-31', '2001-02-28', '2001-03-31', '2001-04-30',
               '2001-05-31', '2001-06-30', '2001-07-31', '2001-08-31',
               '2001-09-30', '2001-10-31', '2001-11-30', '2001-12-31',
               '2002-01-31', '2002-02-28', '2002-03-31', '2002-04-30',
               '2002-05-31', '2002-06-30', '2002-07-31', '2002-08-31',
               '2002-09-30', '2002-10-31', '2002-11-30', '2002-12-31',
               '2003-01-31', '2003-02-28', '2003-03-31', '2003-04-30',
               '2003-05-31', '2003-06-30'],
              dtype='datetime64[ns]', freq='ME')

(BTW: Using "M" here is also deprecated)

from sktime.

benHeid avatar benHeid commented on July 19, 2024

Additional question in coerce_to_period, we are using the frequency information provided, if one is provided. However, would it be possible to let the frequency just be inferred by pandas?

In that case the error from above would not be raised.

from sktime.

jahnvisahni31 avatar jahnvisahni31 commented on July 19, 2024

message hidden, likely AI generated content


The issue you are encountering is related to the limitations of the frequencies supported by pandas PeriodIndex for Periods. Specifically, you mentioned that in pandas 2.2.X, there is a bug where the frequency "2M" is failing to work as expected. It seems that you have observed this issue in pandas 2.2.X, while lower versions are functioning correctly. This issue is relevant to the limitations of period frequencies described in the pandas documentation, specifically the Period Aliases section found at the provided URL.

You mentioned an example code snippet:

ForecastingHorizon([1,2]).to_absolute(pd.date_range("2020", periods=1, freq="2M"))

This code snippet is being impacted by the issue of frequency "2M" not being supported as expected in pandas 2.2.X.

This issue can impact forecasting and time series analysis where the accurate handling of periods and frequencies is crucial.

It's important to note that this issue is related to the specific version of pandas (2.2.X) and the limitations of supported frequencies for Periods.

from sktime.

benHeid avatar benHeid commented on July 19, 2024

Probably duplication of #5131

from sktime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.