You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Floating an idea: pd.PeriodIndex.from_range & pd.DatetimeIndex.from_range as classmethods to mirror pd.period_range & pd.date_range respectively. This encapsulates constructors on the class.
Also could have pd.DatetimeIndex.from_dataframe for #12967
The text was updated successfully, but these errors were encountered:
For the encapsulation - i.e. the ways of creating an instance are all listed on the class. It's also a nice pythonic approach.
While I wouldn't think removing the existing methods would be worth the effort (and maybe that makes adding these new ones a non-starter), the approach of putting constructors on classes in future also helps to keep the pd. namespace cleaner
you realize that these are convenience functions that just call the constructor now (albeit with a default for the freq) Not sure why adding something is helpful here. It would just be another name.
Floating an idea:
pd.PeriodIndex.from_range
&pd.DatetimeIndex.from_range
asclassmethod
s to mirrorpd.period_range
&pd.date_range
respectively. This encapsulates constructors on the class.Also could have
pd.DatetimeIndex.from_dataframe
for #12967The text was updated successfully, but these errors were encountered: