Skip to content

Commit a052b86

Browse files
committed
Merge branch 'master' of https://github.com/pandas-dev/pandas into multiindex_union
2 parents 52b40cf + ad5ee33 commit a052b86

File tree

114 files changed

+2721
-1553
lines changed

Some content is hidden

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

114 files changed

+2721
-1553
lines changed

.pre-commit-config.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
minimum_pre_commit_version: 2.9.2
22
exclude: ^LICENSES/|\.(html|csv|svg)$
3+
ci:
4+
autofix_prs: false
35
repos:
46
- repo: https://github.com/MarcoGorelli/absolufy-imports
57
rev: v0.3.0
@@ -51,7 +53,7 @@ repos:
5153
hooks:
5254
- id: isort
5355
- repo: https://github.com/asottile/pyupgrade
54-
rev: v2.11.0
56+
rev: v2.12.0
5557
hooks:
5658
- id: pyupgrade
5759
args: [--py37-plus]

.travis.yml

+2-9
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,9 @@ matrix:
3535
fast_finish: true
3636

3737
include:
38-
- arch: arm64
38+
- arch: arm64-graviton2
3939
env:
40-
- JOB="3.7, arm64" PYTEST_WORKERS=1 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard and not arm_slow)"
41-
42-
allow_failures:
43-
# Moved to allowed_failures 2020-09-29 due to timeouts https://github.com/pandas-dev/pandas/issues/36719
44-
- arch: arm64
45-
env:
46-
- JOB="3.7, arm64" PYTEST_WORKERS=1 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard and not arm_slow)"
47-
40+
- JOB="3.7, arm64" PYTEST_WORKERS="auto" ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard and not arm_slow)"
4841

4942
before_install:
5043
- echo "before_install"

doc/_templates/sidebar-nav-bs.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
2+
<div class="bd-toc-item active">
3+
{% if pagename.startswith("reference") %}
4+
{{ generate_nav_html("sidebar", maxdepth=4, collapse=True, includehidden=True, titles_only=True) }}
5+
{% else %}
6+
{{ generate_nav_html("sidebar", maxdepth=4, collapse=False, includehidden=True, titles_only=True) }}
7+
{% endif %}
8+
</div>
9+
</nav>
7.14 KB
Loading
7.33 KB
Loading
7.59 KB
Loading
7.1 KB
Loading

doc/source/reference/style.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Styler properties
2323
:toctree: api/
2424

2525
Styler.env
26-
Styler.template
26+
Styler.template_html
2727
Styler.loader
2828

2929
Style application
@@ -53,6 +53,7 @@ Builtin styles
5353
Styler.highlight_null
5454
Styler.highlight_max
5555
Styler.highlight_min
56+
Styler.highlight_between
5657
Styler.background_gradient
5758
Styler.bar
5859

doc/source/user_guide/advanced.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ values across a level. For instance:
498498
)
499499
df = pd.DataFrame(np.random.randn(4, 2), index=midx)
500500
df
501-
df2 = df.mean(level=0)
501+
df2 = df.groupby(level=0).mean()
502502
df2
503503
df2.reindex(df.index, level=0)
504504

doc/source/user_guide/categorical.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ even if some categories are not present in the data:
633633
data=[[1, 2, 3], [4, 5, 6]],
634634
columns=pd.MultiIndex.from_arrays([["A", "B", "B"], columns]),
635635
)
636-
df.sum(axis=1, level=1)
636+
df.groupby(axis=1, level=1).sum()
637637
638638
Groupby will also show "unused" categories:
639639

doc/source/user_guide/groupby.rst

-8
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,6 @@ number:
320320
321321
s.groupby(level="second").sum()
322322
323-
The aggregation functions such as ``sum`` will take the level parameter
324-
directly. Additionally, the resulting index will be named according to the
325-
chosen level:
326-
327-
.. ipython:: python
328-
329-
s.sum(level="second")
330-
331323
Grouping with multiple levels is supported.
332324

333325
.. ipython:: python

doc/source/user_guide/style.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@
17101710
" Styler.loader, # the default\n",
17111711
" ])\n",
17121712
" )\n",
1713-
" template = env.get_template(\"myhtml.tpl\")"
1713+
" template_html = env.get_template(\"myhtml.tpl\")"
17141714
]
17151715
},
17161716
{

doc/source/whatsnew/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Version 1.2
2424
.. toctree::
2525
:maxdepth: 2
2626

27+
v1.2.5
2728
v1.2.4
2829
v1.2.3
2930
v1.2.2

doc/source/whatsnew/v0.15.2.rst

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ Other enhancements:
154154
- ``Series.all`` and ``Series.any`` now support the ``level`` and ``skipna`` parameters (:issue:`8302`):
155155

156156
.. ipython:: python
157+
:okwarning:
157158
158159
s = pd.Series([False, True, False], index=[0, 0, 1])
159160
s.any(level=0)

doc/source/whatsnew/v1.2.4.rst

+5-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _whatsnew_124:
22

3-
What's new in 1.2.4 (April ??, 2021)
4-
---------------------------------------
3+
What's new in 1.2.4 (April 12, 2021)
4+
------------------------------------
55

66
These are the changes in pandas 1.2.4. See :ref:`release` for a full changelog
77
including other versions of pandas.
@@ -20,27 +20,8 @@ Fixed regressions
2020
- Fixed regression in (in)equality comparison of ``pd.NaT`` with a non-datetimelike numpy array returning a scalar instead of an array (:issue:`40722`)
2121
- Fixed regression in :meth:`DataFrame.where` not returning a copy in the case of an all True condition (:issue:`39595`)
2222
- Fixed regression in :meth:`DataFrame.replace` raising ``IndexError`` when ``regex`` was a multi-key dictionary (:issue:`39338`)
23-
-
24-
25-
.. ---------------------------------------------------------------------------
26-
27-
.. _whatsnew_124.bug_fixes:
28-
29-
Bug fixes
30-
~~~~~~~~~
31-
32-
-
33-
-
34-
35-
.. ---------------------------------------------------------------------------
36-
37-
.. _whatsnew_124.other:
38-
39-
Other
40-
~~~~~
41-
42-
-
43-
-
23+
- Fixed regression in repr of floats in an ``object`` column not respecting ``float_format`` when printed in the console or outputted through :meth:`DataFrame.to_string`, :meth:`DataFrame.to_html`, and :meth:`DataFrame.to_latex` (:issue:`40024`)
24+
- Fixed regression in NumPy ufuncs such as ``np.add`` not passing through all arguments for :class:`DataFrame` (:issue:`40662`)
4425

4526
.. ---------------------------------------------------------------------------
4627
@@ -49,4 +30,4 @@ Other
4930
Contributors
5031
~~~~~~~~~~~~
5132

52-
.. contributors:: v1.2.3..v1.2.4|HEAD
33+
.. contributors:: v1.2.3..v1.2.4

doc/source/whatsnew/v1.2.5.rst

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.. _whatsnew_125:
2+
3+
What's new in 1.2.5 (May ??, 2021)
4+
----------------------------------
5+
6+
These are the changes in pandas 1.2.5. See :ref:`release` for a full changelog
7+
including other versions of pandas.
8+
9+
{{ header }}
10+
11+
.. ---------------------------------------------------------------------------
12+
13+
.. _whatsnew_125.regressions:
14+
15+
Fixed regressions
16+
~~~~~~~~~~~~~~~~~
17+
18+
-
19+
-
20+
21+
.. ---------------------------------------------------------------------------
22+
23+
.. _whatsnew_125.bug_fixes:
24+
25+
Bug fixes
26+
~~~~~~~~~
27+
28+
-
29+
-
30+
31+
.. ---------------------------------------------------------------------------
32+
33+
.. _whatsnew_125.other:
34+
35+
Other
36+
~~~~~
37+
38+
-
39+
-
40+
41+
.. ---------------------------------------------------------------------------
42+
43+
.. _whatsnew_125.contributors:
44+
45+
Contributors
46+
~~~~~~~~~~~~
47+
48+
.. contributors:: v1.2.4..v1.2.5|HEAD

doc/source/whatsnew/v1.3.0.rst

+21-8
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ We provided some focused development on :class:`.Styler`, including altering met
117117
to accept more universal CSS language for arguments, such as ``'color:red;'`` instead of
118118
``[('color', 'red')]`` (:issue:`39564`). This is also added to the built-in methods
119119
to allow custom CSS highlighting instead of default background coloring (:issue:`40242`).
120+
Enhancements to other built-in methods include extending the :meth:`.Styler.background_gradient`
121+
method to shade elements based on a given gradient map and not be restricted only to
122+
values in the DataFrame (:issue:`39930` :issue:`22727` :issue:`28901`).
120123

121124
The :meth:`.Styler.apply` now consistently allows functions with ``ndarray`` output to
122125
allow more flexible development of UDFs when ``axis`` is ``None`` ``0`` or ``1`` (:issue:`39393`).
@@ -206,6 +209,7 @@ Other enhancements
206209
- :meth:`.Styler.background_gradient` now allows the ability to supply a specific gradient map (:issue:`22727`)
207210
- :meth:`.Styler.clear` now clears :attr:`Styler.hidden_index` and :attr:`Styler.hidden_columns` as well (:issue:`40484`)
208211
- Builtin highlighting methods in :class:`Styler` have a more consistent signature and css customisability (:issue:`40242`)
212+
- :meth:`.Styler.highlight_between` added to list of builtin styling methods (:issue:`39821`)
209213
- :meth:`Series.loc.__getitem__` and :meth:`Series.loc.__setitem__` with :class:`MultiIndex` now raising helpful error message when indexer has too many dimensions (:issue:`35349`)
210214
- :meth:`pandas.read_stata` and :class:`StataReader` support reading data from compressed files.
211215
- Add support for parsing ``ISO 8601``-like timestamps with negative signs to :meth:`pandas.Timedelta` (:issue:`37172`)
@@ -563,6 +567,7 @@ Deprecations
563567
- Deprecated allowing partial failure in :meth:`Series.transform` and :meth:`DataFrame.transform` when ``func`` is list-like or dict-like and raises anything but ``TypeError``; ``func`` raising anything but a ``TypeError`` will raise in a future version (:issue:`40211`)
564568
- Deprecated support for ``np.ma.mrecords.MaskedRecords`` in the :class:`DataFrame` constructor, pass ``{name: data[name] for name in data.dtype.names}`` instead (:issue:`40363`)
565569
- Deprecated the use of ``**kwargs`` in :class:`.ExcelWriter`; use the keyword argument ``engine_kwargs`` instead (:issue:`40430`)
570+
- Deprecated the ``level`` keyword for :class:`DataFrame` and :class:`Series` aggregations; use groupby instead (:issue:`39983`)
566571

567572
.. ---------------------------------------------------------------------------
568573
@@ -584,6 +589,7 @@ Performance improvements
584589
- Performance improvement in :class:`Styler` where render times are more than 50% reduced (:issue:`39972` :issue:`39952`)
585590
- Performance improvement in :meth:`core.window.ewm.ExponentialMovingWindow.mean` with ``times`` (:issue:`39784`)
586591
- Performance improvement in :meth:`.GroupBy.apply` when requiring the python fallback implementation (:issue:`40176`)
592+
- Performance improvement for concatenation of data with type :class:`CategoricalDtype` (:issue:`40193`)
587593

588594
.. ---------------------------------------------------------------------------
589595
@@ -786,6 +792,7 @@ Reshaping
786792
^^^^^^^^^
787793
- Bug in :func:`merge` raising error when performing an inner join with partial index and ``right_index`` when no overlap between indices (:issue:`33814`)
788794
- Bug in :meth:`DataFrame.unstack` with missing levels led to incorrect index names (:issue:`37510`)
795+
- Bug in :func:`merge_asof` propagating the right Index with ``left_index=True`` and ``right_on`` specification instead of left Index (:issue:`33463`)
789796
- Bug in :func:`join` over :class:`MultiIndex` returned wrong result, when one of both indexes had only one level (:issue:`36909`)
790797
- :meth:`merge_asof` raises ``ValueError`` instead of cryptic ``TypeError`` in case of non-numerical merge columns (:issue:`29130`)
791798
- Bug in :meth:`DataFrame.join` not assigning values correctly when having :class:`MultiIndex` where at least one dimension is from dtype ``Categorical`` with non-alphabetically sorted categories (:issue:`38502`)
@@ -813,26 +820,32 @@ ExtensionArray
813820

814821
- Bug in :meth:`DataFrame.where` when ``other`` is a :class:`Series` with :class:`ExtensionArray` dtype (:issue:`38729`)
815822
- Fixed bug where :meth:`Series.idxmax`, :meth:`Series.idxmin` and ``argmax/min`` fail when the underlying data is :class:`ExtensionArray` (:issue:`32749`, :issue:`33719`, :issue:`36566`)
823+
- Fixed a bug where some properties of subclasses of :class:`PandasExtensionDtype` where improperly cached (:issue:`40329`)
816824
-
817825

826+
Styler
827+
^^^^^^
828+
829+
- Bug in :class:`Styler` where ``subset`` arg in methods raised an error for some valid multiindex slices (:issue:`33562`)
830+
- :class:`Styler` rendered HTML output minor alterations to support w3 good code standard (:issue:`39626`)
831+
- Bug in :class:`Styler` where rendered HTML was missing a column class identifier for certain header cells (:issue:`39716`)
832+
- Bug in :meth:`Styler.background_gradient` where text-color was not determined correctly (:issue:`39888`)
833+
- Bug in :class:`Styler` where multiple elements in CSS-selectors were not correctly added to ``table_styles`` (:issue:`39942`)
834+
- Bug in :class:`.Styler` where copying from Jupyter dropped top left cell and misaligned headers (:issue:`12147`)
835+
- Bug in :class:`.Styler.where` where ``kwargs`` were not passed to the applicable callable (:issue:`40845`)
836+
- Bug in :class:`Styler` which caused CSS to duplicate on multiple renders. (:issue:`39395`, :issue:`40334`)
837+
838+
818839
Other
819840
^^^^^
820841
- Bug in :class:`Index` constructor sometimes silently ignoring a specified ``dtype`` (:issue:`38879`)
821842
- Bug in :func:`pandas.api.types.infer_dtype` not recognizing Series, Index or array with a period dtype (:issue:`23553`)
822843
- Bug in :func:`pandas.api.types.infer_dtype` raising an error for general :class:`.ExtensionArray` objects. It will now return ``"unknown-array"`` instead of raising (:issue:`37367`)
823844
- Bug in constructing a :class:`Series` from a list and a :class:`PandasDtype` (:issue:`39357`)
824-
- Bug in :class:`Styler` which caused CSS to duplicate on multiple renders. (:issue:`39395`, :issue:`40334`)
825845
- ``inspect.getmembers(Series)`` no longer raises an ``AbstractMethodError`` (:issue:`38782`)
826846
- Bug in :meth:`Series.where` with numeric dtype and ``other = None`` not casting to ``nan`` (:issue:`39761`)
827847
- :meth:`Index.where` behavior now mirrors :meth:`Index.putmask` behavior, i.e. ``index.where(mask, other)`` matches ``index.putmask(~mask, other)`` (:issue:`39412`)
828848
- Bug in :func:`pandas.testing.assert_series_equal`, :func:`pandas.testing.assert_frame_equal`, :func:`pandas.testing.assert_index_equal` and :func:`pandas.testing.assert_extension_array_equal` incorrectly raising when an attribute has an unrecognized NA type (:issue:`39461`)
829-
- Bug in :class:`Styler` where ``subset`` arg in methods raised an error for some valid multiindex slices (:issue:`33562`)
830-
- :class:`Styler` rendered HTML output minor alterations to support w3 good code standard (:issue:`39626`)
831-
- Bug in :class:`Styler` where rendered HTML was missing a column class identifier for certain header cells (:issue:`39716`)
832-
- Bug in :meth:`Styler.background_gradient` where text-color was not determined correctly (:issue:`39888`)
833-
- Bug in :class:`Styler` where multiple elements in CSS-selectors were not correctly added to ``table_styles`` (:issue:`39942`)
834-
- Bug in :class:`.Styler` where copying from Jupyter dropped top left cell and misaligned headers (:issue:`12147`)
835-
- Bug in :class:`.Styler.where` where ``kwargs`` were not passed to the applicable callable (:issue:`40845`)
836849
- Bug in :meth:`DataFrame.equals`, :meth:`Series.equals`, :meth:`Index.equals` with object-dtype containing ``np.datetime64("NaT")`` or ``np.timedelta64("NaT")`` (:issue:`39650`)
837850
- Bug in :func:`pandas.util.show_versions` where console JSON output was not proper JSON (:issue:`39701`)
838851
- Bug in :meth:`DataFrame.convert_dtypes` incorrectly raised ValueError when called on an empty DataFrame (:issue:`40393`)

0 commit comments

Comments
 (0)