Skip to content

QST: DatetimeIndex changes #35390

Closed
Closed
@mboldin-temple

Description

@mboldin-temple
  • I have searched the [pandas] tag on StackOverflow for similar questions.

  • I have asked my usage related question on StackOverflow.


Question about pandas

In version 1.0.5, DatetimeIndex seems greatly changed from earlier versions
Was this intentional and documented in the version changes?

Many statsmodels forecasting steps now break

For example, the code below no longer works

dx = pd.DatetimeIndex(start ='2020-01-01 00:00', freq ='M', periods = 12)

I get
TypeError: new() got an unexpected keyword argument 'start'

The documentation has these arguments

class pandas.DatetimeIndex(data=None, freq=None, tz=None, normalize=False, closed=None, ambiguous='raise', dayfirst=False, yearfirst=False, dtype=None, copy=False, name=None)[source]

with little explanation or usefulness IMHO

I see old Pandas has
def new(cls, data=None,
freq=None, start=None, end=None, periods=None, tz=None,
normalize=False, closed=None, ambiguous='raise',
dayfirst=False, yearfirst=False, dtype=None,
copy=False, name=None, verify_integrity=True):

# Your code here, if applicable
# Create the DatetimeIndex 
dx = pd.DatetimeIndex(start ='2020-01-01 00:00', freq ='M',  periods = 12)
## expect TypeError: __new__() got an unexpected keyword argument 'start'

Metadata

Metadata

Assignees

No one assigned

    Labels

    DatetimeDatetime data dtypeDeprecateFunctionality to remove in pandas

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions