Skip to content

DOC: add section on groupby().rolling/expanding/resample #14801

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

Merged
merged 5 commits into from
Dec 10, 2016
Merged

DOC: add section on groupby().rolling/expanding/resample #14801

merged 5 commits into from
Dec 10, 2016

Conversation

wandersoncferreira
Copy link

@wandersoncferreira wandersoncferreira commented Dec 5, 2016

This is my first PR here. Not sure about the missing entries in API reference. Need some guidance on that. The same doubt about the best place to put the xref in computation.rst and timeseries.rst

Thanks.

@wandersoncferreira
Copy link
Author

wandersoncferreira commented Dec 5, 2016

@jorisvandenbossche can you help me with more information about the failed test below?

@wandersoncferreira wandersoncferreira changed the title DOC - groupby.resample DOC: groupby.resample Dec 6, 2016
@jorisvandenbossche
Copy link
Member

@wandersoncferreira you can ignore the AppVeyor error, that is a problem on our end unrelated to this PR. Travis did pass.

@@ -214,6 +214,10 @@ computing common *window* or *rolling* statistics. Among these are count, sum,
mean, median, correlation, variance, covariance, standard deviation, skewness,
and kurtosis.

Now the ``rolling()`` and ``expanding()`` functions can be used directly from
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

say starting in 0.18.1


df = pd.DataFrame({'A': [1] * 20 + [2] * 12,
'B': np.arange(32)})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a line showing df


df.groupby('A').rolling(4).B.mean()

.. note::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need the note


df.groupby('group').resample('1D').ffill()

.. note::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the note, show df (as its different from above).



Example of the ``expanding()``:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this after rolling (and re-use the same df)

@@ -1288,6 +1288,9 @@ limited to, financial applications.
``.resample()`` is a time-based groupby, followed by a reduction method on each of its groups.
See some :ref:`cookbook examples <cookbook.resample>` for some advanced strategies

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

starting in 0.18.1

@codecov-io
Copy link

codecov-io commented Dec 8, 2016

Current coverage is 85.28% (diff: 100%)

Merging #14801 into master will increase coverage by <.01%

@@             master     #14801   diff @@
==========================================
  Files           144        144          
  Lines         50947      50968    +21   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43445      43467    +22   
+ Misses         7502       7501     -1   
  Partials          0          0          

Powered by Codecov. Last update 5d0e157...b0fa254

@wandersoncferreira
Copy link
Author

@jreback thanks for your comments. Let me know if I can make it even better.

@jorisvandenbossche jorisvandenbossche added this to the 0.20.0 milestone Dec 10, 2016
@jorisvandenbossche jorisvandenbossche changed the title DOC: groupby.resample DOC: add section on groupby().rolling/expanding/resample Dec 10, 2016
@jorisvandenbossche jorisvandenbossche merged commit 6e09022 into pandas-dev:master Dec 10, 2016
@jorisvandenbossche
Copy link
Member

@wandersoncferreira Thanks!

yarikoptic added a commit to neurodebian/pandas that referenced this pull request Dec 12, 2016
* origin/master: (22 commits)
  BUG: astype falsely converts inf to integer (GH14265) (pandas-dev#14343)
  BUG: Apply min_itemsize to index even when not appending
  DOC: warning section on memory overflow when joining/merging dataframes on index with duplicate keys (pandas-dev#14788)
  BLD: missing - on secure
  BLD: new access token on pandas-dev
  TST: Test DatetimeIndex weekend offset (pandas-dev#14853)
  BLD: escape GH_TOKEN in build_docs
  TST: Correct results with np.size and crosstab (pandas-dev#4003) (pandas-dev#14755)
  Frame benchmarking sum instead of mean (pandas-dev#14824)
  CLN: lint of test_base.py
  BUG: Allow TZ-aware DatetimeIndex in merge_asof() (pandas-dev#14844)
  BUG: GH11847 Unstack with mixed dtypes coerces everything to object
  TST: skip testing on windows for specific formatting which sometimes hangs (pandas-dev#14851)
  BLD: try new gh token for pandas-docs
  CLN/PERF: clean-up of the benchmarks (pandas-dev#14099)
  ENH: add timedelta as valid type for interpolate with method='time' (pandas-dev#14799)
  DOC: add section on groupby().rolling/expanding/resample (pandas-dev#14801)
  TST: add test to confirm GH14606 (specify category dtype for empty) (pandas-dev#14752)
  BLD: use org name in build-docs.sh
  BF(TST): use = (native) instead of < (little endian) for target data types (pandas-dev#14832)
  ...
yarikoptic added a commit to neurodebian/pandas that referenced this pull request Dec 12, 2016
* commit 'v0.19.0-174-g81a2f79': (156 commits)
  BLD: escape GH_TOKEN in build_docs
  TST: Correct results with np.size and crosstab (pandas-dev#4003) (pandas-dev#14755)
  Frame benchmarking sum instead of mean (pandas-dev#14824)
  CLN: lint of test_base.py
  BUG: Allow TZ-aware DatetimeIndex in merge_asof() (pandas-dev#14844)
  BUG: GH11847 Unstack with mixed dtypes coerces everything to object
  TST: skip testing on windows for specific formatting which sometimes hangs (pandas-dev#14851)
  BLD: try new gh token for pandas-docs
  CLN/PERF: clean-up of the benchmarks (pandas-dev#14099)
  ENH: add timedelta as valid type for interpolate with method='time' (pandas-dev#14799)
  DOC: add section on groupby().rolling/expanding/resample (pandas-dev#14801)
  TST: add test to confirm GH14606 (specify category dtype for empty) (pandas-dev#14752)
  BLD: use org name in build-docs.sh
  BF(TST): use = (native) instead of < (little endian) for target data types (pandas-dev#14832)
  ENH: Introduce UnsortedIndexError  GH11897 (pandas-dev#14762)
  ENH: Add the ability to have a separate title for each subplot when plotting (pandas-dev#14753)
  DOC: Fix grammar and formatting typos (pandas-dev#14803)
  BLD: try new build credentials for pandas-docs
  TST: Test pivot with categorical data
  MAINT: Cleanup pandas/src/parser (pandas-dev#14740)
  ...
yarikoptic added a commit to neurodebian/pandas that referenced this pull request Dec 12, 2016
release 0.19.1 was from release branch

* releases: (156 commits)
  BLD: escape GH_TOKEN in build_docs
  TST: Correct results with np.size and crosstab (pandas-dev#4003) (pandas-dev#14755)
  Frame benchmarking sum instead of mean (pandas-dev#14824)
  CLN: lint of test_base.py
  BUG: Allow TZ-aware DatetimeIndex in merge_asof() (pandas-dev#14844)
  BUG: GH11847 Unstack with mixed dtypes coerces everything to object
  TST: skip testing on windows for specific formatting which sometimes hangs (pandas-dev#14851)
  BLD: try new gh token for pandas-docs
  CLN/PERF: clean-up of the benchmarks (pandas-dev#14099)
  ENH: add timedelta as valid type for interpolate with method='time' (pandas-dev#14799)
  DOC: add section on groupby().rolling/expanding/resample (pandas-dev#14801)
  TST: add test to confirm GH14606 (specify category dtype for empty) (pandas-dev#14752)
  BLD: use org name in build-docs.sh
  BF(TST): use = (native) instead of < (little endian) for target data types (pandas-dev#14832)
  ENH: Introduce UnsortedIndexError  GH11897 (pandas-dev#14762)
  ENH: Add the ability to have a separate title for each subplot when plotting (pandas-dev#14753)
  DOC: Fix grammar and formatting typos (pandas-dev#14803)
  BLD: try new build credentials for pandas-docs
  TST: Test pivot with categorical data
  MAINT: Cleanup pandas/src/parser (pandas-dev#14740)
  ...
ischurov pushed a commit to ischurov/pandas that referenced this pull request Dec 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: document groupby.resample/rolling
4 participants