Skip to content

Commit ea42697

Browse files
committed
rebase and cleanup
1 parent 4ecc479 commit ea42697

File tree

4 files changed

+0
-135
lines changed

4 files changed

+0
-135
lines changed

doc/source/whatsnew/v0.21.0.txt

-32
Original file line numberDiff line numberDiff line change
@@ -309,28 +309,12 @@ New keywords
309309
- :func:`read_feather` has gained the ``nthreads`` parameter for multi-threaded operations (:issue:`16359`)
310310
- :func:`DataFrame.clip()` and :func:`Series.clip()` have gained an ``inplace`` argument. (:issue:`15388`)
311311
- :func:`crosstab` has gained a ``margins_name`` parameter to define the name of the row / column that will contain the totals when ``margins=True``. (:issue:`15972`)
312-
<<<<<<< HEAD
313-
- :func:`DataFrame.select_dtypes` now accepts scalar values for include/exclude as well as list-like. (:issue:`16855`)
314-
- :func:`date_range` now accepts 'YS' in addition to 'AS' as an alias for start of year (:issue:`9313`)
315-
- :func:`date_range` now accepts 'Y' in addition to 'A' as an alias for end of year (:issue:`9313`)
316-
- Integration with `Apache Parquet <https://parquet.apache.org/>`__, including a new top-level :func:`read_parquet` and :func:`DataFrame.to_parquet` method, see :ref:`here <io.parquet>`.
317-
- :func:`DataFrame.add_prefix` and :func:`DataFrame.add_suffix` now accept strings containing the '%' character. (:issue:`17151`)
318-
- `read_*` methods can now infer compression from non-string paths, such as ``pathlib.Path`` objects (:issue:`17206`).
319-
- :func:`pd.read_sas()` now recognizes much more of the most frequently used date (datetime) formats in SAS7BDAT files (:issue:`15871`).
320-
- :func:`DataFrame.items` and :func:`Series.items` is now present in both Python 2 and 3 and is lazy in all cases (:issue:`13918`, :issue:`17213`)
321-
<<<<<<< HEAD
322-
<<<<<<< HEAD
323-
<<<<<<< HEAD
324-
<<<<<<< HEAD
325-
326-
=======
327312
- :func:`read_json` now accepts a ``chunksize`` parameter that can be used when ``lines=True``. If ``chunksize`` is passed, read_json now returns an iterator which reads in ``chunksize`` lines with each iteration. (:issue:`17048`)
328313
- :func:`read_json` and :func:`~DataFrame.to_json` now accept a ``compression`` argument which allows them to transparently handle compressed files. (:issue:`17798`)
329314

330315
Various enhancements
331316
""""""""""""""""""""
332317

333-
>>>>>>> 95d4ba8... ENH: gb.is_monotonic_increasing #17015 fix rebase conflicts
334318
- Improved the import time of pandas by about 2.25x. (:issue:`16764`)
335319
- Support for `PEP 519 -- Adding a file system path protocol
336320
<https://www.python.org/dev/peps/pep-0519/>`_ on most readers (e.g.
@@ -354,22 +338,6 @@ Various enhancements
354338
- :func:`read_excel` raises ``ImportError`` with a better message if ``xlrd`` is not installed. (:issue:`17613`)
355339
- :meth:`DataFrame.assign` will preserve the original order of ``**kwargs`` for Python 3.6+ users instead of sorting the column names. (:issue:`14207`)
356340
- :func:`Series.reindex`, :func:`DataFrame.reindex`, :func:`Index.get_indexer` now support list-like argument for ``tolerance``. (:issue:`17367`)
357-
<<<<<<< HEAD
358-
=======
359-
- :func: groupby.is_monotonic_increasing and .is_monotonic_decreasing extend Series.is_monotonic_increasing to groups, returning whether each group is monotonically increasing or decreasing, respectively. (:issue:`17015`)
360-
=======
361-
- is_monotonic_increasing/decreasing is added to .groupby(). (:issue:`17015`)
362-
>>>>>>> 740c7c2... added tests for gb.is_monotonically_increasing()/decreasing
363-
=======
364-
>>>>>>> 8ed37cd... removed edits to whatsnew 0.21.0
365-
366-
>>>>>>> e99897c... ENH: gb.is_monotonic_increasing, is_monotonic_decreasing #17015
367-
=======
368-
369-
370-
>>>>>>> ceceae1... ENH: gb.is_monotonic_increasing #17015 fix rebase conflicts
371-
=======
372-
>>>>>>> 95d4ba8... ENH: gb.is_monotonic_increasing #17015 fix rebase conflicts
373341

374342
.. _whatsnew_0210.api_breaking:
375343

pandas/core/groupby.py

-3
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,6 @@ def tail(self, n=5):
16951695
mask = self._cumcount_array(ascending=False) < n
16961696
return self._selected_obj[mask]
16971697

1698-
<<<<<<< HEAD
16991698
def pipe(self, func, *args, **kwargs):
17001699
""" Apply a function with arguments to this GroupBy object,
17011700
@@ -1744,8 +1743,6 @@ def pipe(self, func, *args, **kwargs):
17441743
"""
17451744
return _pipe(self, func, *args, **kwargs)
17461745

1747-
=======
1748-
>>>>>>> e99897c... ENH: gb.is_monotonic_increasing, is_monotonic_decreasing #17015
17491746
@Substitution(name='groupby')
17501747
@Appender(_doc_template)
17511748
def is_monotonic_increasing(self):

pandas/tests/groupby/test_groupby.py

-81
Original file line numberDiff line numberDiff line change
@@ -3701,8 +3701,6 @@ def test_cummin_cummax(self):
37013701
expected = pd.Series([1, 2, 1], name='b')
37023702
tm.assert_series_equal(result, expected)
37033703

3704-
<<<<<<< HEAD
3705-
<<<<<<< HEAD
37063704
@pytest.mark.parametrize('in_vals, out_vals', [
37073705
# Basics: strictly increasing (T), strictly decreasing (F),
37083706
# abs val increasing (F), non-strictly increasing (T)
@@ -3761,85 +3759,6 @@ def test_is_monotonic_decreasing(self, in_vals, out_vals):
37613759
expected.index.name = 'B'
37623760
tm.assert_series_equal(result, expected)
37633761

3764-
=======
3765-
def test_is_increasing_is_decreasing(self):
3766-
# GH 17015
3767-
3768-
=======
3769-
@pytest.mark.parametrize('in_vals, out_vals', [
3770-
>>>>>>> f8554ee... parametrized tests for gb.is_monotonic_increasing/decreasing
3771-
# Basics: strictly increasing (T), strictly decreasing (F),
3772-
# abs val increasing (F), non-strictly increasing (T)
3773-
([1, 2, 5, 3, 2, 0, 4, 5, -6, 1, 1],
3774-
[True, False, False, True]),
3775-
# Test with inf vals
3776-
([1, 2.1, np.inf, 3, 2, np.inf, -np.inf, 5, 11, 1, -np.inf],
3777-
[True, False, True, False]),
3778-
# Test with nan vals; should always be False
3779-
([1, 2, np.nan, 3, 2, np.nan, np.nan, 5, -np.inf, 1, np.nan],
3780-
[False, False, False, False]),
3781-
])
3782-
def test_is_monotonic_increasing(self, in_vals, out_vals):
3783-
# GH 17015
3784-
source_dict = {
3785-
'A': ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'],
3786-
'B': ['a', 'a', 'a', 'b', 'b', 'b', 'c', 'c', 'c', 'd', 'd'],
3787-
'C': in_vals}
3788-
df = pd.DataFrame(source_dict)
3789-
result = df.groupby(['B']).C.is_monotonic_increasing()
3790-
expected = pd.Series(index=['a', 'b', 'c', 'd'],
3791-
data=out_vals,
3792-
name='C')
3793-
expected.index.name = 'B'
3794-
tm.assert_series_equal(result, expected)
3795-
3796-
# Also check result equal to manually taking x.is_monotonic_increasing.
3797-
expected = (
3798-
df.groupby(['B']).C.apply(lambda x: x.is_monotonic_increasing))
3799-
tm.assert_series_equal(result, expected)
3800-
3801-
@pytest.mark.parametrize('in_vals, out_vals', [
3802-
# Basics: strictly decreasing (T), strictly increasing (F),
3803-
# abs val decreasing (F), non-strictly increasing (T)
3804-
([10, 9, 7, 3, 4, 5, -3, 2, 0, 1, 1],
3805-
[True, False, False, True]),
3806-
# Test with inf vals
3807-
([np.inf, 1, -np.inf, np.inf, 2, -3, -np.inf, 5, -3, -np.inf, -np.inf],
3808-
[True, True, False, True]),
3809-
# Test with nan vals; should always be False
3810-
([1, 2, np.nan, 3, 2, np.nan, np.nan, 5, -np.inf, 1, np.nan],
3811-
[False, False, False, False]),
3812-
])
3813-
def test_is_monotonic_decreasing(self, in_vals, out_vals):
3814-
# GH 17015
3815-
source_dict = {
3816-
'A': ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'],
3817-
'B': ['a', 'a', 'a', 'b', 'b', 'b', 'c', 'c', 'c', 'd', 'd'],
3818-
'C': in_vals}
3819-
3820-
df = pd.DataFrame(source_dict)
3821-
result = df.groupby('B').C.is_monotonic_decreasing()
3822-
expected = pd.Series(index=['a', 'b', 'c', 'd'],
3823-
data=out_vals,
3824-
name='C')
3825-
expected.index.name = 'B'
3826-
tm.assert_series_equal(result, expected)
3827-
<<<<<<< HEAD
3828-
>>>>>>> 740c7c2... added tests for gb.is_monotonically_increasing()/decreasing
3829-
=======
3830-
3831-
>>>>>>> f8554ee... parametrized tests for gb.is_monotonic_increasing/decreasing
3832-
# Also check result equal to manually taking x.is_monotonic_decreasing.
3833-
expected = df.groupby('B').C.apply(lambda x: x.is_monotonic_decreasing)
3834-
tm.assert_series_equal(result, expected)
3835-
3836-
<<<<<<< HEAD
3837-
<<<<<<< HEAD
3838-
=======
3839-
3840-
>>>>>>> 740c7c2... added tests for gb.is_monotonically_increasing()/decreasing
3841-
=======
3842-
>>>>>>> f8554ee... parametrized tests for gb.is_monotonic_increasing/decreasing
38433762
def test_apply_numeric_coercion_when_datetime(self):
38443763
# In the past, group-by/apply operations have been over-eager
38453764
# in converting dtypes to numeric, in the presence of datetime

pandas/tests/groupby/test_whitelist.py

-19
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ def test_groupby_blacklist(df_letters):
239239
def test_tab_completion(mframe):
240240
grp = mframe.groupby(level='second')
241241
results = set([v for v in dir(grp) if not v.startswith('_')])
242-
<<<<<<< HEAD
243242
expected = set(
244243
['A', 'B', 'C', 'agg', 'aggregate', 'apply', 'boxplot', 'filter',
245244
'first', 'get_group', 'groups', 'hist', 'indices', 'last', 'max',
@@ -250,26 +249,8 @@ def test_tab_completion(mframe):
250249
'cumsum', 'cumcount', 'ngroup', 'all', 'shift', 'skew',
251250
'take', 'tshift', 'pct_change', 'any', 'mad', 'corr', 'corrwith',
252251
'cov', 'dtypes', 'ndim', 'diff', 'idxmax', 'idxmin',
253-
<<<<<<< HEAD
254252
'ffill', 'bfill', 'pad', 'backfill', 'rolling', 'expanding', 'pipe',
255-
=======
256-
'ffill', 'bfill', 'pad', 'backfill', 'rolling', 'expanding',
257-
>>>>>>> e99897c... ENH: gb.is_monotonic_increasing, is_monotonic_decreasing #17015
258253
'is_monotonic_increasing', 'is_monotonic_decreasing'])
259-
=======
260-
expected = {
261-
'A', 'B', 'C', 'agg', 'aggregate', 'apply', 'boxplot', 'filter',
262-
'first', 'get_group', 'groups', 'hist', 'indices', 'last', 'max',
263-
'mean', 'median', 'min', 'ngroups', 'nth', 'ohlc', 'plot',
264-
'prod', 'size', 'std', 'sum', 'transform', 'var', 'sem', 'count',
265-
'nunique', 'head', 'describe', 'cummax', 'quantile',
266-
'rank', 'cumprod', 'tail', 'resample', 'cummin', 'fillna',
267-
'cumsum', 'cumcount', 'ngroup', 'all', 'shift', 'skew',
268-
'take', 'tshift', 'pct_change', 'any', 'mad', 'corr', 'corrwith',
269-
'cov', 'dtypes', 'ndim', 'diff', 'idxmax', 'idxmin',
270-
'ffill', 'bfill', 'pad', 'backfill', 'rolling', 'expanding', 'pipe',
271-
'is_monotonic_increasing', 'is_monotonic_decreasing'}
272-
>>>>>>> ceceae1... ENH: gb.is_monotonic_increasing #17015 fix rebase conflicts
273254
assert results == expected
274255

275256

0 commit comments

Comments
 (0)