-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
DEPR: 'kind' kwd in resample #55946
Comments
I'm not sure this can be deprecated with the arguments provided. It seems to me you are assuming the starting dataframe has a monotonic index, like one timestamp per month. What if the starting dataframe has a ragged index, like many random timestamps during each month which are completely different for every month and then I want to resample to Here is an example dataframe with ragged timestamps that I want to convert to a monotonic period index with resample: i=pandas.DatetimeIndex(['2023-02-13 20:29:59.734000+00:00',
'2023-02-16 15:30:00.765000+00:00',
'2023-03-02 14:32:00.990000+00:00',
'2023-03-21 19:49:59.705000+00:00',
'2023-03-31 04:00:00.476000+00:00',
'2023-04-18 13:01:00+00:00',
'2023-05-11 19:13:00.455000+00:00',
'2023-05-17 17:44:59.577000+00:00',
'2023-05-31 23:30:00.562000+00:00',
'2023-06-09 12:41:59.915000+00:00',
'2023-06-21 10:36:00.319000+00:00',
'2023-07-05 18:01:49+00:00',
'2023-07-07 21:48:13+00:00',
'2023-07-13 01:14:33+00:00',
'2023-08-08 08:02:56+00:00',
'2023-08-22 07:41:23+00:00',
'2023-09-12 17:16:48+00:00',
'2023-09-15 06:50:31+00:00',
'2023-09-21 21:19:05+00:00',
'2023-09-25 17:09:19+00:00',
'2023-09-25 17:13:00+00:00',
'2023-10-19 13:45:44+00:00',
'2023-10-24 23:22:35+00:00',
'2023-11-08 16:58:00+00:00',
'2023-11-10 01:18:24+00:00',
'2023-11-14 20:28:23+00:00',
'2023-11-16 16:18:00+00:00',
'2023-11-21 01:47:16+00:00',
'2023-11-24 01:53:01+00:00',
'2023-11-25 03:25:13+00:00',
'2023-11-30 23:11:16+00:00',
'2023-12-05 12:03:42+00:00',
'2023-12-14 00:50:55+00:00',
'2023-12-19 14:32:41+00:00',
'2023-12-26 13:43:27+00:00',
'2023-12-29 06:27:49+00:00',
'2024-01-02 16:57:00.395000+00:00',
'2024-01-04 23:24:25+00:00',
'2024-01-16 01:00:00.905000+00:00',
'2024-01-23 19:39:25+00:00',
'2024-01-24 10:55:44+00:00',
'2024-01-24 23:06:07+00:00',
'2024-01-30 18:47:10+00:00',
'2024-02-06 09:30:00.566000+00:00',
'2024-02-07 13:30:00+00:00',
'2024-02-09 03:02:04+00:00',
'2024-02-22 00:13:11+00:00',
'2024-02-26 17:44:22+00:00',
'2024-02-27 23:47:36+00:00',
'2024-03-06 02:20:07+00:00'],
dtype='datetime64[ns, UTC]', name='time', freq=None)
df=pandas.DataFrame(index=i,data=dict(any=range(50)))
df.resample(rule='ME', kind='period').agg('last') Since input is ragged, I can't convert it with To have Please do not deprecate the |
The 'kind' keyword in resample lets you pretend you have a PeriodIndex instead of a DatetimeIndex, and vice-versa. Users who need the other one can just convert using to_(period|timestamp) before calling resample.
xref #55895
The text was updated successfully, but these errors were encountered: