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
Assignment operations will raise a ``ValueError``:
274
+
275
+
.. code-block:: python
276
+
277
+
In [7]: r.iloc[0] = 5
278
+
ValueError: .resample() is now a deferred operation
279
+
use .resample(...).mean() instead of .resample(...)
280
+
assignment will have no effect as you are working on a copy
281
+
282
+
**New API**:
283
+
250
284
Now, you write ``.resample`` as a 2-stage operation like groupby, which
251
285
yields a ``Resampler``.
252
286
@@ -269,13 +303,13 @@ These are downsampling operations (going from a lower frequency to a higher one)
269
303
270
304
r.sum()
271
305
272
-
Furthermore, resample now supports ``getitem`` operations to selectively perform the resample.
306
+
Furthermore, resample now supports ``getitem`` operations to perform the resample on specific columns.
273
307
274
308
.. ipython:: python
275
309
276
310
r[['A','C']].mean()
277
311
278
-
and ``.aggregate`` type of operations.
312
+
and ``.aggregate`` type operations.
279
313
280
314
.. ipython:: python
281
315
@@ -290,8 +324,11 @@ These accessors can of course, be combined
290
324
Upsampling
291
325
''''''''''
292
326
327
+
.. currentmodule:: pandas.tseries.resample
328
+
293
329
Upsampling operations take you from a higher frequency to a lower frequency. These are now
294
-
performed with the ``Resampler`` objects with pad/fill/upsample methods.
330
+
performed with the ``Resampler`` objects with :meth:`~Resampler.pad`,
331
+
:meth:`~Resampler.ffill`, and :meth:`~Resampler.upsample` methods.
295
332
296
333
.. ipython:: python
297
334
@@ -326,7 +363,7 @@ New API
326
363
327
364
s.resample('M').ffill()
328
365
329
-
:: note:
366
+
.. note::
330
367
331
368
In the new API, you can either downsample OR upsample. The prior implementation would allow you to pass an aggregator function (like ``mean``) even though you were upsampling, provide a bit of confusion.
0 commit comments