Skip to content

QST: DatetimeIndex changes #35390

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

Closed
1 of 2 tasks
mboldin-temple opened this issue Jul 23, 2020 · 3 comments
Closed
1 of 2 tasks

QST: DatetimeIndex changes #35390

mboldin-temple opened this issue Jul 23, 2020 · 3 comments
Labels
Datetime Datetime data dtype Deprecate Functionality to remove in pandas

Comments

@mboldin-temple
Copy link

mboldin-temple commented Jul 23, 2020

  • 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'
@mboldin-temple mboldin-temple added Needs Triage Issue that has not been reviewed by a pandas team member Usage Question labels Jul 23, 2020
@mboldin-temple mboldin-temple changed the title QST: QST: DatetimeIndex changes Jul 23, 2020
@mboldin-temple
Copy link
Author

I see now it is documented in What's New
Removed the previously deprecated keywords “start”, “end”, and “periods” from the DatetimeIndex, TimedeltaIndex, and PeriodIndex constructors; use date_range(), timedelta_range(), and period_range() instead (GH23919)

and date_range() works as I need it

Still some statsmodels routines will fail when expecting to use start= as a keyword

@jreback
Copy link
Contributor

jreback commented Jul 23, 2020

these were deprecated in 0.24.0 and removed in 1.0.x. you should push statsmodels to update this.

@jreback jreback closed this as completed Jul 23, 2020
@jreback jreback added Deprecate Functionality to remove in pandas Datetime Datetime data dtype and removed Needs Triage Issue that has not been reviewed by a pandas team member Usage Question labels Jul 23, 2020
@jreback jreback added this to the No action milestone Jul 23, 2020
@jreback
Copy link
Contributor

jreback commented Jul 23, 2020

xref #23919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Deprecate Functionality to remove in pandas
Projects
None yet
Development

No branches or pull requests

2 participants