8000 Fixed docstrings as referenced in issue no: #24071 by killerontherun1 · Pull Request #26520 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

Fixed docstrings as referenced in issue no: #24071 #26520

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
wants to merge 65 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
62deebc
Fixed docstrings as referenced in issue no: #24071
May 25, 2019
129b40c
CLN: remove __bytes__ (#26447)
topper-123 May 19, 2019
60d2438
BUG: Fix #25959 - Don't call .array in DatetimeLikeArrayMixin's map (…
ThomasKluiters May 19, 2019
843d372
DEPR: Change .ix DeprecationWarning -> FutureWarning (#26438)
jorisvandenbossche May 19, 2019
81ad35d
BUG: bugfix 26390 assigning PandasArray to DataFrame error (#26417)
shantanu-gontia May 19, 2019
a141cc5
BUG: fix calling local references with keyword arguments in query (#2…
danielhrisca May 19, 2019
5a8aad7
TST/DEPR: remove .ix from tests\indexing\multiindex\test_loc.py (#26451)
simonjayhawkins May 19, 2019
e3af0ce
BUG: ngroups and len(groups) do not equal when grouping with a list o…
shantanu-gontia May 20, 2019
323eb5e
BUG-20629 allow .at accessor with CategoricalIndex (#26298)
JustinZhengBC May 20, 2019
a5ce533
BUG: Exception when frame constructed from dict of iterators (#26356)
topper-123 May 20, 2019
f294d30
Add defensive check for argument errors keyword in to_numeric (#26466)
sumanau7 May 20, 2019
e98df14
DOC: fix example with Timestamp/integer addition (#26467)
jorisvandenbossche May 20, 2019
9fb07d6
DOC: whatsnew fixes
gfyoung May 20, 2019
1f6a751
DOC: #25723 passing kwargs to excel document engine (#26465)
Dunni3 May 20, 2019
198f7b8
DEPR: deprecate SparseArray.values (#26421)
jorisvandenbossche May 21, 2019
9712c2e
ENH - Index set operation modifications to address issue #23525 (#23538)
ms7463 May 21, 2019
6879e25
DOC/CLN: wil -> will (#26484)
simonjayhawkins May 21, 2019
be6d194
Fixed typo mutiplication -> multiplication. (#26489)
javabrett May 22, 2019
fbdea8c
DOC: fix SyntaxError in doc build on Windows (#26499)
simonjayhawkins May 23, 2019
8eb0c08
DOC: Highlighted role of index alignment in DataFrame.dot(other) (#26…
matsmaiwald May 23, 2019
b8d46a4
DOC/CLN: Change API reference section title (#26486)
simonjayhawkins May 24, 2019
736d2c5
CLN: Remove StringMixin from PandasObject (#26505)
topper-123 May 24, 2019
81acbef
Fix type annotations in pandas.core.indexes.datetimes (#26404)
vaibhavhrt May 24, 2019
4fa2a28
Better error message for DataFrame.hist() without numerical columns (…
matsmaiwald May 24, 2019
385fced
Excel Test Cleanup - ReadWriteClass (#26473)
WillAyd May 24, 2019
5cc13b5
CLN: pd.TimeGrouper (#26477)
mroeschke May 24, 2019
b72832d
CLN: Remove ExcelWriter.sheetname (#26464)
mroeschke May 25, 2019
3e32dcd
Merge branch 'master' into docstring_fix
May 25, 2019
67ebeb9
Fixed GL01 and GL02 in pandas.api
May 26, 2019
3b57213
GL01 and GL02 solved for pandas.eval
May 26, 2019
c9d2fb5
solved GL01 GL02 for pandas.HDFStore
May 26, 2019
0341bf4
solved GL01 GL02 for pandas.Index.T
May 26, 2019
dbbf44d
Fixed GL01 and GL02 in pandas.api
May 26, 2019
19fd64b
GL01 and GL02 solved for pandas.eval
May 26, 2019
f00abcf
solved GL01 GL02 for pandas.HDFStore
May 26, 2019
9dbf25f
CLN: remove __bytes__ (#26447)
topper-123 May 19, 2019
526c4df
BUG: Fix #25959 - Don't call .array in DatetimeLikeArrayMixin's map (…
ThomasKluiters May 19, 2019
612dc08
DEPR: Change .ix DeprecationWarning -> FutureWarning (#26438)
jorisvandenbossche May 19, 2019
62aee5a
BUG: bugfix 26390 assigning PandasArray to DataFrame error (#26417)
shantanu-gontia May 19, 2019
7b33e85
BUG: fix calling local references with keyword arguments in query (#2…
danielhrisca May 19, 2019
d69b8ce
TST/DEPR: remove .ix from tests\indexing\multiindex\test_loc.py (#26451)
simonjayhawkins May 19, 2019
c648673
BUG: ngroups and len(groups) do not equal when grouping with a list o…
shantanu-gontia May 20, 2019
5861fc9
BUG-20629 allow .at accessor with CategoricalIndex (#26298)
JustinZhengBC May 20, 2019
b68ca02
BUG: Exception when frame constructed from dict of iterators (#26356)
topper-123 May 20, 2019
c2d13dc
Add defensive check for argument errors keyword in to_numeric (#26466)
sumanau7 May 20, 2019
e588b69
DOC: fix example with Timestamp/integer addition (#26467)
jorisvandenbossche May 20, 2019
39b4db2
DOC: whatsnew fixes
gfyoung May 20, 2019
e1af4aa
DOC: #25723 passing kwargs to excel document engine (#26465)
Dunni3 May 20, 2019
0eb589b
DEPR: deprecate SparseArray.values (#26421)
jorisvandenbossche May 21, 2019
407eee1
ENH - Index set operation modifications to address issue #23525 (#23538)
ms7463 May 21, 2019
dbe8837
DOC/CLN: wil -> will (#26484)
simonjayhawkins May 21, 2019
35d517d
Fixed typo mutiplication -> multiplication. (#26489)
javabrett May 22, 2019
0b28ddf
DOC: fix SyntaxError in doc build on Windows (#26499)
simonjayhawkins May 23, 2019
b3c191a
DOC: Highlighted role of index alignment in DataFrame.dot(other) (#26…
matsmaiwald May 23, 2019
c75f08f
DOC/CLN: Change API reference section title (#26486)
simonjayhawkins May 24, 2019
030240f
CLN: Remove StringMixin from PandasObject (#26505)
topper-123 May 24, 2019
6105c62
Fix type annotations in pandas.core.indexes.datetimes (#26404)
vaibhavhrt May 24, 2019
1eca8b7
Better error message for DataFrame.hist() without numerical columns (…
matsmaiwald May 24, 2019
5e2b989
Excel Test Cleanup - ReadWriteClass (#26473)
WillAyd May 24, 2019
ea8822c
CLN: pd.TimeGrouper (#26477)
mroeschke May 24, 2019
c1cbc6d
CLN: Remove ExcelWriter.sheetname (#26464)
mroeschke May 25, 2019
d122189
GL01 and GL02 solved for pandas.eval
May 26, 2019
32211fc
solved GL01 GL02 for pandas.Index.T
May 26, 2019
15f1fa3
Merge branch 'docstring_fix' of https://github.com/killerontherun1/pa…
May 26, 2019
3d10423
Revert "Fixed docstrings as referenced in issue no: #24071"
May 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CLN: pd.TimeGrouper (#26477)
  • Loading branch information
mroeschke authored and killerontherun1 committed May 25, 2019
commit 5cc13b5441e462497a1e068c0de3a5ca5ee5af4a
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.25.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ Removal of prior version deprecations/changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Removed ``Panel`` (:issue:`25047`, :issue:`25191`, :issue:`25231`)
-
-
- Removed previously deprecated ``TimeGrouper`` (:issue:`16942`)
-

.. _whatsnew_0250.performance:
Expand Down
2 changes: 1 addition & 1 deletion pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
to_numeric, to_datetime, to_timedelta,

# misc
np, TimeGrouper, Grouper, factorize, unique, value_counts,
np, Grouper, factorize, unique, value_counts,
array, Categorical, set_eng_float_format, Series, DataFrame,
Panel)

Expand Down
12 changes: 0 additions & 12 deletions pandas/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,3 @@
from pandas.tseries.offsets import DateOffset
from pandas.core.tools.datetimes import to_datetime
from pandas.core.tools.timedeltas import to_timedelta


# Deprecation: xref gh-16747
class TimeGrouper:

def __new__(cls, *args, **kwargs):
from pandas.core.resample import TimeGrouper
import warnings
warnings.warn("pd.TimeGrouper is deprecated and will be removed; "
"Please use pd.Grouper(freq=...)",
FutureWarning, stacklevel=2)
return TimeGrouper(*args, **kwargs)
13 changes: 1 addition & 12 deletions pandas/tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TestPDApi(Base):
]

# these are already deprecated; awaiting removal
deprecated_classes = ['TimeGrouper', 'Panel']
deprecated_classes = ['Panel']

# these should be deprecated in the future
deprecated_classes_in_future = []
Expand Down Expand Up @@ -132,17 +132,6 @@ def test_testing(self):
self.check(testing, self.funcs)


class TestTopLevelDeprecations:

# top-level API deprecations
# GH 13790

def test_TimeGrouper(self):
with tm.assert_produces_warning(FutureWarning,
check_stacklevel=False):
pd.TimeGrouper(freq='D')


class TestCDateRange:

def test_deprecation_cdaterange(self):
Expand Down
7 changes: 3 additions & 4 deletions pandas/tests/groupby/test_timegrouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import pandas as pd
from pandas import DataFrame, Index, MultiIndex, Series, Timestamp, date_range
from pandas.core.groupby.grouper import Grouper
from pandas.core.groupby.ops import BinGrouper
from pandas.util import testing as tm
from pandas.util.testing import assert_frame_equal, assert_series_equal
Expand Down Expand Up @@ -365,10 +366,8 @@ def sumfunc_value(x):
return x.value.sum()

expected = df.groupby(pd.Grouper(key='date')).apply(sumfunc_value)
with tm.assert_produces_warning(FutureWarning,
check_stacklevel=False):
result = (df_dt.groupby(pd.TimeGrouper(freq='M', key='date'))
.apply(sumfunc_value))
result = (df_dt.groupby(Grouper(freq='M', key='date'))
.apply(sumfunc_value))
assert_series_equal(result.reset_index(drop=True),
expected.reset_index(drop=True))

Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/resample/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import pandas as pd
from pandas import DataFrame, Series
from pandas.core.groupby.groupby import DataError
from pandas.core.groupby.grouper import Grouper
from pandas.core.indexes.datetimes import date_range
from pandas.core.indexes.period import PeriodIndex, period_range
from pandas.core.indexes.timedeltas import TimedeltaIndex, timedelta_range
from pandas.core.resample import TimeGrouper
import pandas.util.testing as tm
from pandas.util.testing import (
assert_almost_equal, assert_frame_equal, assert_index_equal,
Expand Down Expand Up @@ -214,7 +214,7 @@ def test_apply_to_empty_series(empty_series):
def test_resampler_is_iterable(series):
# GH 15314
freq = 'H'
tg = TimeGrouper(freq, convention='start')
tg = Grouper(freq=freq, convention='start')
grouped = series.groupby(tg)
resampled = series.resample(freq)
for (rk, rv), (gk, gv) in zip(resampled, grouped):
Expand Down
14 changes: 7 additions & 7 deletions pandas/tests/resample/test_datetime_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

import pandas as pd
from pandas import DataFrame, Series, Timedelta, Timestamp, isna, notna
from pandas.core.groupby.grouper import Grouper
from pandas.core.indexes.datetimes import date_range
from pandas.core.indexes.period import Period, period_range
from pandas.core.resample import (
DatetimeIndex, TimeGrouper, _get_timestamp_range_edges)
from pandas.core.resample import DatetimeIndex, _get_timestamp_range_edges
import pandas.util.testing as tm
from pandas.util.testing import (
assert_almost_equal, assert_frame_equal, assert_series_equal)
Expand Down Expand Up @@ -42,15 +42,15 @@ def test_custom_grouper(index):
dti = index
s = Series(np.array([1] * len(dti)), index=dti, dtype='int64')

b = TimeGrouper(Minute(5))
b = Grouper(freq=Minute(5))
g = s.groupby(b)

# check all cython functions work
funcs = ['add', 'mean', 'prod', 'ohlc', 'min', 'max', 'var']
for f in funcs:
g._cython_agg_general(f)

b = TimeGrouper(Minute(5), closed='right', label='right')
b = Grouper(freq=Minute(5), closed='right', label='right')
g = s.groupby(b)
# check all cython functions work
funcs = ['add', 'mean', 'prod', 'ohlc', 'min', 'max', 'var']
Expand Down Expand Up @@ -116,7 +116,7 @@ def test_resample_integerarray():
def test_resample_basic_grouper(series):
s = series
result = s.resample('5Min').last()
grouper = TimeGrouper(Minute(5), closed='left', label='left')
grouper = Grouper(freq=Minute(5), closed='left', label='left')
expected = s.groupby(grouper).agg(lambda x: x[-1])
assert_series_equal(result, expected)

Expand Down Expand Up @@ -373,7 +373,7 @@ def test_resample_upsampling_picked_but_not_correct():
def test_resample_frame_basic():
df = tm.makeTimeDataFrame()

b = TimeGrouper('M')
b = Grouper(freq='M')
g = df.groupby(b)

# check all cython functions work
Expand Down Expand Up @@ -521,7 +521,7 @@ def test_nearest_upsample_with_limit():
def test_resample_ohlc(series):
s = series

grouper = TimeGrouper(Minute(5))
grouper = Grouper(freq=Minute(5))
expect = s.groupby(grouper).agg(lambda x: x[-1])
result = s.resample('5Min').ohlc()

Expand Down
24 changes: 10 additions & 14 deletions pandas/tests/resample/test_time_grouper.py
3262
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import pandas as pd
from pandas import DataFrame, Series
from pandas.core.groupby.grouper import Grouper
from pandas.core.indexes.datetimes import date_range
from pandas.core.resample import TimeGrouper
import pandas.util.testing as tm
from pandas.util.testing import assert_frame_equal, assert_series_equal

Expand All @@ -16,9 +16,7 @@


def test_apply():
with tm.assert_produces_warning(FutureWarning,
check_stacklevel=False):
grouper = pd.TimeGrouper(freq='A', label='right', closed='right')
grouper = Grouper(freq='A', label='right', closed='right')

grouped = test_series.groupby(grouper)

Expand All @@ -38,9 +36,7 @@ def test_count():

expected = test_series.groupby(lambda x: x.year).count()

with tm.assert_produces_warning(FutureWarning,
check_stacklevel=False):
grouper = pd.TimeGrouper(freq='A', label='right', closed='right')
grouper = Grouper(freq='A', label='right', closed='right')
result = test_series.groupby(grouper).count()
expected.index = result.index
assert_series_equal(result, expected)
Expand All @@ -64,7 +60,7 @@ def test_apply_iteration():
N = 1000
ind = pd.date_range(start="2000-01-01", freq="D", periods=N)
df = DataFrame({'open': 1, 'close': 2}, index=ind)
tg = TimeGrouper('M')
tg = Grouper(freq='M')

_, grouper, _ = tg._get_grouper(df)

Expand Down Expand Up @@ -93,7 +89,7 @@ def test_fails_on_no_datetime_index(name, func):
msg = ("Only valid with DatetimeIndex, TimedeltaIndex "
"or PeriodIndex, but got an instance of '{}'".format(name))
with pytest.raises(TypeError, match=msg):
df.groupby(TimeGrouper('D'))
df.groupby(Grouper(freq='D'))


def test_aaa_group_order():
Expand All @@ -105,7 +101,7 @@ def test_aaa_group_order():
df['key'] = [datetime(2013, 1, 1), datetime(2013, 1, 2),
datetime(2013, 1, 3), datetime(2013, 1, 4),
datetime(2013, 1, 5)] * 4
grouped = df.groupby(TimeGrouper(key='key', freq='D'))
grouped = df.groupby(Grouper(key='key', freq='D'))

tm.assert_frame_equal(grouped.get_group(datetime(2013, 1, 1)),
df[::5])
Expand Down Expand Up @@ -135,7 +131,7 @@ def test_aggregate_normal(resample_method):
datetime(2013, 1, 5)] * 4

normal_grouped = normal_df.groupby('key')
dt_grouped = dt_df.groupby(TimeGrouper(key='key', freq='D'))
dt_grouped = dt_df.groupby(Grouper(key='key', freq='D'))

expected = getattr(normal_grouped, resample_method)()
dt_result = getattr(dt_grouped, resample_method)()
Expand Down Expand Up @@ -195,7 +191,7 @@ def test_aggregate_with_nat(func, fill_value):
datetime(2013, 1, 4), datetime(2013, 1, 5)] * 4

normal_grouped = normal_df.groupby('key')
dt_grouped = dt_df.groupby(TimeGrouper(key='key', freq='D'))
dt_grouped = dt_df.groupby(Grouper(key='key', freq='D'))

normal_result = getattr(normal_grouped, func)()
dt_result = getattr(dt_grouped, func)()
Expand All @@ -222,7 +218,7 @@ def test_aggregate_with_nat_size():
datetime(2013, 1, 4), datetime(2013, 1, 5)] * 4

normal_grouped = normal_df.groupby('key')
dt_grouped = dt_df.groupby(TimeGrouper(key='key', freq='D'))
dt_grouped = dt_df.groupby(Grouper(key='key', freq='D'))

normal_result = normal_grouped.size()
dt_result = dt_grouped.size()
Expand All @@ -238,7 +234,7 @@ def test_aggregate_with_nat_size():

def test_repr():
# GH18203
result = repr(TimeGrouper(key='A', freq='H'))
result = repr(Grouper(key='A', freq='H'))
expected = ("TimeGrouper(key='A', freq=<Hour>, axis=0, sort=True, "
"closed='left', label='left', how='mean', "
"convention='e', base=0)")
Expand Down
0