Skip to content

Commit 457c58e

Browse files
committed
Merge branch 'master' into GH22895_fix_docstring_for_set_axis_name
2 parents bc865d4 + 4976ee1 commit 457c58e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1219
-649
lines changed

.travis.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,20 @@ matrix:
5353
- dist: trusty
5454
env:
5555
- JOB="3.6, coverage" ENV_FILE="ci/travis-36.yaml" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate" COVERAGE=true DOCTEST=true
56-
# In allow_failures
57-
- dist: trusty
58-
env:
59-
- JOB="3.6, slow" ENV_FILE="ci/travis-36-slow.yaml" SLOW=true
60-
# In allow_failures
56+
6157
- dist: trusty
6258
env:
6359
- JOB="3.7, NumPy dev" ENV_FILE="ci/travis-37-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network -W error" PANDAS_TESTING_MODE="deprecate"
6460
addons:
6561
apt:
6662
packages:
6763
- xsel
64+
65+
# In allow_failures
66+
- dist: trusty
67+
env:
68+
- JOB="3.6, slow" ENV_FILE="ci/travis-36-slow.yaml" SLOW=true
69+
6870
# In allow_failures
6971
- dist: trusty
7072
env:
@@ -73,13 +75,6 @@ matrix:
7375
- dist: trusty
7476
env:
7577
- JOB="3.6, slow" ENV_FILE="ci/travis-36-slow.yaml" SLOW=true
76-
- dist: trusty
77-
env:
78-
- JOB="3.7, NumPy dev" ENV_FILE="ci/travis-37-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network -W error" PANDAS_TESTING_MODE="deprecate"
79-
addons:
80-
apt:
81-
packages:
82-
- xsel
8378
- dist: trusty
8479
env:
8580
- JOB="3.6, doc" ENV_FILE="ci/travis-36-doc.yaml" DOC=true

asv_bench/benchmarks/indexing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import numpy as np
44
import pandas.util.testing as tm
5-
from pandas import (Series, DataFrame, MultiIndex, Int64Index, Float64Index,
6-
IntervalIndex, CategoricalIndex,
7-
IndexSlice, concat, date_range)
8-
from .pandas_vb_common import setup, Panel # noqa
5+
from pandas import (Series, DataFrame, MultiIndex, Panel,
6+
Int64Index, Float64Index, IntervalIndex,
7+
CategoricalIndex, IndexSlice, concat, date_range)
8+
from .pandas_vb_common import setup # noqa
99

1010

1111
class NumericSeriesIndexing(object):

asv_bench/benchmarks/join_merge.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33

44
import numpy as np
55
import pandas.util.testing as tm
6-
from pandas import (DataFrame, Series, MultiIndex, date_range, concat, merge,
7-
merge_asof)
6+
from pandas import (DataFrame, Series, Panel, MultiIndex,
7+
date_range, concat, merge, merge_asof)
8+
89
try:
910
from pandas import merge_ordered
1011
except ImportError:
1112
from pandas import ordered_merge as merge_ordered
1213

13-
from .pandas_vb_common import Panel, setup # noqa
14+
from .pandas_vb_common import setup # noqa
1415

1516

1617
class Append(object):

asv_bench/benchmarks/panel_ctor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import warnings
22
from datetime import datetime, timedelta
33

4-
from pandas import DataFrame, DatetimeIndex, date_range
4+
from pandas import DataFrame, Panel, DatetimeIndex, date_range
55

6-
from .pandas_vb_common import Panel, setup # noqa
6+
from .pandas_vb_common import setup # noqa
77

88

99
class DifferentIndexes(object):

asv_bench/benchmarks/panel_methods.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import warnings
22

33
import numpy as np
4+
from pandas import Panel
45

5-
from .pandas_vb_common import Panel, setup # noqa
6+
from .pandas_vb_common import setup # noqa
67

78

89
class PanelMethods(object):

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
- template: ci/azure/windows.yml
1919
parameters:
2020
name: Windows
21-
vmImage: vs2017-win2017
21+
vmImage: vs2017-win2016
2222
- template: ci/azure/windows-py27.yml
2323
parameters:
2424
name: WindowsPy27
25-
vmImage: vs2017-win2017
25+
vmImage: vs2017-win2016

ci/travis-27.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ dependencies:
4444
# universal
4545
- pytest
4646
- pytest-xdist
47-
- moto
47+
- moto==1.3.4
4848
- hypothesis>=3.58.0
4949
- pip:
5050
- backports.lzma

ci/travis-36-doc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212
- html5lib
1313
- hypothesis>=3.58.0
1414
- ipykernel
15-
- ipython
15+
- ipython==6.5.0
1616
- ipywidgets
1717
- lxml
1818
- matplotlib

doc/source/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ If your change involves checking that a warning is actually emitted, use
880880

881881
.. code-block:: python
882882
883-
with tm.assert_prodcues_warning(FutureWarning):
883+
with tm.assert_produces_warning(FutureWarning):
884884
df.some_operation()
885885
886886
We prefer this to the ``pytest.warns`` context manager because ours checks that the warning's

doc/source/whatsnew/v0.24.0.txt

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ Other Enhancements
199199

200200
Backwards incompatible API changes
201201
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
202+
- A newly constructed empty :class:`DataFrame` with integer as the ``dtype`` will now only be cast to ``float64`` if ``index`` is specified (:issue:`22858`)
202203

203204

204205
.. _whatsnew_0240.api_breaking.interval_values:
@@ -505,6 +506,7 @@ ExtensionType Changes
505506
- :meth:`Series.astype` and :meth:`DataFrame.astype` now dispatch to :meth:`ExtensionArray.astype` (:issue:`21185:`).
506507
- Slicing a single row of a ``DataFrame`` with multiple ExtensionArrays of the same type now preserves the dtype, rather than coercing to object (:issue:`22784`)
507508
- Added :meth:`pandas.api.types.register_extension_dtype` to register an extension type with pandas (:issue:`22664`)
509+
- Updated the ``.type`` attribute for ``PeriodDtype``, ``DatetimeTZDtype``, and ``IntervalDtype`` to be instances of the dtype (``Period``, ``Timestamp``, and ``Interval`` respectively) (:issue:`22938`)
508510

509511
.. _whatsnew_0240.api.incompatibilities:
510512

@@ -532,6 +534,35 @@ Current Behavior:
532534
...
533535
OverflowError: Trying to coerce negative values to unsigned integers
534536

537+
.. _whatsnew_0240.api.crosstab_dtypes
538+
539+
Crosstab Preserves Dtypes
540+
^^^^^^^^^^^^^^^^^^^^^^^^^
541+
542+
:func:`crosstab` will preserve now dtypes in some cases that previously would
543+
cast from integer dtype to floating dtype (:issue:`22019`)
544+
545+
Previous Behavior:
546+
547+
.. code-block:: ipython
548+
549+
In [3]: df = pd.DataFrame({'a': [1, 2, 2, 2, 2], 'b': [3, 3, 4, 4, 4],
550+
...: 'c': [1, 1, np.nan, 1, 1]})
551+
In [4]: pd.crosstab(df.a, df.b, normalize='columns')
552+
Out[4]:
553+
b 3 4
554+
a
555+
1 0.5 0.0
556+
2 0.5 1.0
557+
558+
Current Behavior:
559+
560+
.. code-block:: ipython
561+
562+
In [3]: df = pd.DataFrame({'a': [1, 2, 2, 2, 2], 'b': [3, 3, 4, 4, 4],
563+
...: 'c': [1, 1, np.nan, 1, 1]})
564+
In [4]: pd.crosstab(df.a, df.b, normalize='columns')
565+
535566
Datetimelike API Changes
536567
^^^^^^^^^^^^^^^^^^^^^^^^
537568

@@ -666,7 +697,7 @@ Timedelta
666697
- Bug in :class:`Index` with numeric dtype when multiplying or dividing an array with dtype ``timedelta64`` (:issue:`22390`)
667698
- Bug in :class:`TimedeltaIndex` incorrectly allowing indexing with ``Timestamp`` object (:issue:`20464`)
668699
- Fixed bug where subtracting :class:`Timedelta` from an object-dtyped array would raise ``TypeError`` (:issue:`21980`)
669-
-
700+
- Fixed bug in adding a :class:`DataFrame` with all-`timedelta64[ns]` dtypes to a :class:`DataFrame` with all-integer dtypes returning incorrect results instead of raising ``TypeError`` (:issue:`22696`)
670701
-
671702

672703
Timezones
@@ -794,6 +825,7 @@ Groupby/Resample/Rolling
794825
- Bug in :meth:`Resampler.asfreq` when frequency of ``TimedeltaIndex`` is a subperiod of a new frequency (:issue:`13022`).
795826
- Bug in :meth:`SeriesGroupBy.mean` when values were integral but could not fit inside of int64, overflowing instead. (:issue:`22487`)
796827
- :func:`RollingGroupby.agg` and :func:`ExpandingGroupby.agg` now support multiple aggregation functions as parameters (:issue:`15072`)
828+
- Bug in :meth:`DataFrame.resample` and :meth:`Series.resample` when resampling by a weekly offset (``'W'``) across a DST transition (:issue:`9119`, :issue:`21459`)
797829

798830
Sparse
799831
^^^^^^
@@ -817,6 +849,7 @@ Reshaping
817849
- Bug in :meth:`DataFrame.drop_duplicates` for empty ``DataFrame`` which incorrectly raises an error (:issue:`20516`)
818850
- Bug in :func:`pandas.wide_to_long` when a string is passed to the stubnames argument and a column name is a substring of that stubname (:issue:`22468`)
819851
- Bug in :func:`merge` when merging ``datetime64[ns, tz]`` data that contained a DST transition (:issue:`18885`)
852+
- Bug in :func:`merge_asof` when merging on float values within defined tolerance (:issue:`22981`)
820853

821854
Build Changes
822855
^^^^^^^^^^^^^
@@ -834,4 +867,3 @@ Other
834867
- :meth:`DataFrame.nlargest` and :meth:`DataFrame.nsmallest` now returns the correct n values when keep != 'all' also when tied on the first columns (:issue:`22752`)
835868
- :meth:`~pandas.io.formats.style.Styler.bar` now also supports tablewise application (in addition to rowwise and columnwise) with ``axis=None`` and setting clipping range with ``vmin`` and ``vmax`` (:issue:`21548` and :issue:`21526`). ``NaN`` values are also handled properly.
836869
- Logical operations ``&, |, ^`` between :class:`Series` and :class:`Index` will no longer raise ``ValueError`` (:issue:`22092`)
837-
-

0 commit comments

Comments
 (0)