Skip to content

Commit 2555ba4

Browse files
authored
Merge branch 'master' into single_level
2 parents 8491a76 + 1cad9e5 commit 2555ba4

Some content is hidden

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

48 files changed

+1640
-786
lines changed

doc/source/development/contributing.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1275,8 +1275,8 @@ Performance matters and it is worth considering whether your code has introduced
12751275
performance regressions. pandas is in the process of migrating to
12761276
`asv benchmarks <https://github.com/spacetelescope/asv>`__
12771277
to enable easy monitoring of the performance of critical pandas operations.
1278-
These benchmarks are all found in the ``pandas/asv_bench`` directory. asv
1279-
supports both python2 and python3.
1278+
These benchmarks are all found in the ``pandas/asv_bench`` directory, and the
1279+
test results can be found `here <https://pandas.pydata.org/speed/pandas/#/>`__.
12801280

12811281
To use all features of asv, you will need either ``conda`` or
12821282
``virtualenv``. For more details please check the `asv installation

doc/source/ecosystem.rst

+17
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,23 @@ A good implementation for Python users is `has2k1/plotnine <https://github.com/h
153153
Spun off from the main pandas library, the `qtpandas <https://github.com/draperjames/qtpandas>`__
154154
library enables DataFrame visualization and manipulation in PyQt4 and PySide applications.
155155

156+
`D-Tale <https://github.com/man-group/dtale>`__
157+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
158+
159+
D-Tale is a lightweight web client for visualizing pandas data structures. It
160+
provides a rich spreadsheet-style grid which acts as a wrapper for a lot of
161+
pandas functionality (query, sort, describe, corr...) so users can quickly
162+
manipulate their data. There is also an interactive chart-builder using Plotly
163+
Dash allowing users to build nice portable visualizations. D-Tale can be
164+
invoked with the following command
165+
166+
.. code:: python
167+
168+
import dtale; dtale.show(df)
169+
170+
D-Tale integrates seamlessly with jupyter notebooks, python terminals, kaggle
171+
& Google Colab. Here are some demos of the `grid <http://alphatechadmin.pythonanywhere.com/>`__
172+
and `chart-builder <http://alphatechadmin.pythonanywhere.com/charts/4?chart_type=surface&query=&x=date&z=Col0&agg=raw&cpg=false&y=%5B%22security_id%22%5D>`__.
156173

157174
.. _ecosystem.ide:
158175

doc/source/reference/frame.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,14 @@ Reshaping, sorting, transposing
240240
DataFrame.T
241241
DataFrame.transpose
242242

243-
Combining / joining / merging
244-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
243+
Combining / comparing / joining / merging
244+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
245245
.. autosummary::
246246
:toctree: api/
247247

248248
DataFrame.append
249249
DataFrame.assign
250+
DataFrame.compare
250251
DataFrame.join
251252
DataFrame.merge
252253
DataFrame.update

doc/source/reference/offset_frequency.rst

+31
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ Properties
5959
BusinessDay.normalize
6060
BusinessDay.rule_code
6161
BusinessDay.n
62+
BusinessDay.weekmask
63+
BusinessDay.holidays
64+
BusinessDay.calendar
6265

6366
Methods
6467
~~~~~~~
@@ -95,6 +98,9 @@ Properties
9598
BusinessHour.n
9699
BusinessHour.start
97100
BusinessHour.end
101+
BusinessHour.weekmask
102+
BusinessHour.holidays
103+
BusinessHour.calendar
98104

99105
Methods
100106
~~~~~~~
@@ -128,6 +134,9 @@ Properties
128134
CustomBusinessDay.normalize
129135
CustomBusinessDay.rule_code
130136
CustomBusinessDay.n
137+
CustomBusinessDay.weekmask
138+
CustomBusinessDay.calendar
139+
CustomBusinessDay.holidays
131140

132141
Methods
133142
~~~~~~~
@@ -162,6 +171,9 @@ Properties
162171
CustomBusinessHour.normalize
163172
CustomBusinessHour.rule_code
164173
CustomBusinessHour.n
174+
CustomBusinessHour.weekmask
175+
CustomBusinessHour.calendar
176+
CustomBusinessHour.holidays
165177
CustomBusinessHour.start
166178
CustomBusinessHour.end
167179

@@ -334,6 +346,9 @@ Properties
334346
CustomBusinessMonthEnd.normalize
335347
CustomBusinessMonthEnd.rule_code
336348
CustomBusinessMonthEnd.n
349+
CustomBusinessMonthEnd.weekmask
350+
CustomBusinessMonthEnd.calendar
351+
CustomBusinessMonthEnd.holidays
337352

338353
Methods
339354
~~~~~~~
@@ -368,6 +383,9 @@ Properties
368383
CustomBusinessMonthBegin.normalize
369384
CustomBusinessMonthBegin.rule_code
370385
CustomBusinessMonthBegin.n
386+
CustomBusinessMonthBegin.weekmask
387+
CustomBusinessMonthBegin.calendar
388+
CustomBusinessMonthBegin.holidays
371389

372390
Methods
373391
~~~~~~~
@@ -1241,6 +1259,9 @@ Properties
12411259
BDay.offset
12421260
BDay.rule_code
12431261
BDay.n
1262+
BDay.weekmask
1263+
BDay.holidays
1264+
BDay.calendar
12441265

12451266
Methods
12461267
~~~~~~~
@@ -1356,6 +1377,9 @@ Properties
13561377
CBMonthEnd.offset
13571378
CBMonthEnd.rule_code
13581379
CBMonthEnd.n
1380+
CBMonthEnd.weekmask
1381+
CBMonthEnd.holidays
1382+
CBMonthEnd.calendar
13591383

13601384
Methods
13611385
~~~~~~~
@@ -1397,6 +1421,9 @@ Properties
13971421
CBMonthBegin.offset
13981422
CBMonthBegin.rule_code
13991423
CBMonthBegin.n
1424+
CBMonthBegin.weekmask
1425+
CBMonthBegin.holidays
1426+
CBMonthBegin.calendar
14001427

14011428
Methods
14021429
~~~~~~~
@@ -1435,6 +1462,9 @@ Properties
14351462
CDay.offset
14361463
CDay.rule_code
14371464
CDay.n
1465+
CDay.weekmask
1466+
CDay.calendar
1467+
CDay.holidays
14381468

14391469
Methods
14401470
~~~~~~~
@@ -1452,6 +1482,7 @@ Methods
14521482
CDay.rollforward
14531483
CDay.__call__
14541484

1485+
14551486
.. _api.frequencies:
14561487

14571488
===========

doc/source/reference/series.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,13 @@ Reshaping, sorting
240240
Series.squeeze
241241
Series.view
242242

243-
Combining / joining / merging
244-
-----------------------------
243+
Combining / comparing / joining / merging
244+
-----------------------------------------
245245
.. autosummary::
246246
:toctree: api/
247247

248248
Series.append
249+
Series.compare
249250
Series.replace
250251
Series.update
251252

doc/source/user_guide/merging.rst

+64-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@
1010
p = doctools.TablePlotter()
1111
1212
13-
****************************
14-
Merge, join, and concatenate
15-
****************************
13+
************************************
14+
Merge, join, concatenate and compare
15+
************************************
1616

1717
pandas provides various facilities for easily combining together Series or
1818
DataFrame with various kinds of set logic for the indexes
1919
and relational algebra functionality in the case of join / merge-type
2020
operations.
2121

22+
In addition, pandas also provides utilities to compare two Series or DataFrame
23+
and summarize their differences.
24+
2225
.. _merging.concat:
2326

2427
Concatenating objects
@@ -1477,3 +1480,61 @@ exclude exact matches on time. Note that though we exclude the exact matches
14771480
by='ticker',
14781481
tolerance=pd.Timedelta('10ms'),
14791482
allow_exact_matches=False)
1483+
1484+
.. _merging.compare:
1485+
1486+
Comparing objects
1487+
-----------------
1488+
1489+
The :meth:`~Series.compare` and :meth:`~DataFrame.compare` methods allow you to
1490+
compare two DataFrame or Series, respectively, and summarize their differences.
1491+
1492+
This feature was added in :ref:`V1.1.0 <whatsnew_110.dataframe_or_series_comparing>`.
1493+
1494+
For example, you might want to compare two `DataFrame` and stack their differences
1495+
side by side.
1496+
1497+
.. ipython:: python
1498+
1499+
df = pd.DataFrame(
1500+
{
1501+
"col1": ["a", "a", "b", "b", "a"],
1502+
"col2": [1.0, 2.0, 3.0, np.nan, 5.0],
1503+
"col3": [1.0, 2.0, 3.0, 4.0, 5.0]
1504+
},
1505+
columns=["col1", "col2", "col3"],
1506+
)
1507+
df
1508+
1509+
.. ipython:: python
1510+
1511+
df2 = df.copy()
1512+
df2.loc[0, 'col1'] = 'c'
1513+
df2.loc[2, 'col3'] = 4.0
1514+
df2
1515+
1516+
.. ipython:: python
1517+
1518+
df.compare(df2)
1519+
1520+
By default, if two corresponding values are equal, they will be shown as ``NaN``.
1521+
Furthermore, if all values in an entire row / column, the row / column will be
1522+
omitted from the result. The remaining differences will be aligned on columns.
1523+
1524+
If you wish, you may choose to stack the differences on rows.
1525+
1526+
.. ipython:: python
1527+
1528+
df.compare(df2, align_axis=0)
1529+
1530+
If you wish to keep all original rows and columns, set `keep_shape` argument
1531+
to ``True``.
1532+
1533+
.. ipython:: python
1534+
1535+
df.compare(df2, keep_shape=True)
1536+
1537+
You may also keep all the original values even if they are equal.
1538+
1539+
.. ipython:: python
1540+
df.compare(df2, keep_shape=True, keep_equal=True)

doc/source/user_guide/visualization.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ You can create a scatter plot matrix using the
821821
df = pd.DataFrame(np.random.randn(1000, 4), columns=['a', 'b', 'c', 'd'])
822822
823823
@savefig scatter_matrix_kde.png
824-
scatter_matrix(df, alpha=0.2, figsize=(6, 6), diagonal='kde')
824+
scatter_matrix(df, alpha=0.2, figsize=(6, 6), diagonal='kde');
825825
826826
.. ipython:: python
827827
:suppress:
@@ -1683,4 +1683,4 @@ to generate the plots. Some libraries implementing a backend for pandas are list
16831683
on the ecosystem :ref:`ecosystem.visualization` page.
16841684

16851685
Developers guide can be found at
1686-
https://dev.pandas.io/docs/development/extending.html#plotting-backends
1686+
https://pandas.pydata.org/docs/dev/development/extending.html#plotting-backends

doc/source/whatsnew/index.rst

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

27+
v1.0.4
2728
v1.0.3
2829
v1.0.2
2930
v1.0.1

doc/source/whatsnew/v1.0.3.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ Bug fixes
2626
Contributors
2727
~~~~~~~~~~~~
2828

29-
.. contributors:: v1.0.2..v1.0.3|HEAD
29+
.. contributors:: v1.0.2..v1.0.3

doc/source/whatsnew/v1.0.4.rst

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
.. _whatsnew_104:
3+
4+
What's new in 1.0.4 (May 28, 2020)
5+
------------------------------------
6+
7+
These are the changes in pandas 1.0.4. See :ref:`release` for a full changelog
8+
including other versions of pandas.
9+
10+
{{ header }}
11+
12+
.. ---------------------------------------------------------------------------
13+
14+
.. _whatsnew_104.regressions:
15+
16+
Fixed regressions
17+
~~~~~~~~~~~~~~~~~
18+
- Fix regression where :meth:`Series.isna` and :meth:`DataFrame.isna` would raise for categorical dtype when ``pandas.options.mode.use_inf_as_na`` was set to ``True`` (:issue:`33594`)
19+
- Fix regression in :meth:`GroupBy.first` and :meth:`GroupBy.last` where None is not preserved in object dtype (:issue:`32800`)
20+
- Fix regression in DataFrame reductions using ``numeric_only=True`` and ExtensionArrays (:issue:`33256`).
21+
- Fix performance regression in ``memory_usage(deep=True)`` for object dtype (:issue:`33012`)
22+
- Fix regression where :meth:`Categorical.replace` would replace with ``NaN`` whenever the new value and replacement value were equal (:issue:`33288`)
23+
- Fix regression where an ordered :class:`Categorical` containing only ``NaN`` values would raise rather than returning ``NaN`` when taking the minimum or maximum (:issue:`33450`)
24+
- Fix regression in :meth:`DataFrameGroupBy.agg` with dictionary input losing ``ExtensionArray`` dtypes (:issue:`32194`)
25+
- Fix to preserve the ability to index with the "nearest" method with xarray's CFTimeIndex, an :class:`Index` subclass (`pydata/xarray#3751 <https://github.com/pydata/xarray/issues/3751>`_, :issue:`32905`).
26+
- Fix regression in :meth:`DataFrame.describe` raising ``TypeError: unhashable type: 'dict'`` (:issue:`32409`)
27+
- Fix regression in :meth:`DataFrame.replace` casts columns to ``object`` dtype if items in ``to_replace`` not in values (:issue:`32988`)
28+
- Fix regression in :meth:`Series.groupby` would raise ``ValueError`` when grouping by :class:`PeriodIndex` level (:issue:`34010`)
29+
- Fix regression in :meth:`GroupBy.rolling.apply` ignores args and kwargs parameters (:issue:`33433`)
30+
- Fix regression in error message with ``np.min`` or ``np.max`` on unordered :class:`Categorical` (:issue:`33115`)
31+
- Fix regression in :meth:`DataFrame.loc` and :meth:`Series.loc` throwing an error when a ``datetime64[ns, tz]`` value is provided (:issue:`32395`)
32+
33+
.. _whatsnew_104.bug_fixes:
34+
35+
Bug fixes
36+
~~~~~~~~~
37+
- Bug in :meth:`SeriesGroupBy.first`, :meth:`SeriesGroupBy.last`, :meth:`SeriesGroupBy.min`, and :meth:`SeriesGroupBy.max` returning floats when applied to nullable Booleans (:issue:`33071`)
38+
- Bug in :meth:`Rolling.min` and :meth:`Rolling.max`: Growing memory usage after multiple calls when using a fixed window (:issue:`30726`)
39+
- Bug in :meth:`~DataFrame.to_parquet` was not raising ``PermissionError`` when writing to a private s3 bucket with invalid creds. (:issue:`27679`)
40+
- Bug in :meth:`~DataFrame.to_csv` was silently failing when writing to an invalid s3 bucket. (:issue:`32486`)
41+
- Bug in :meth:`read_parquet` was raising a ``FileNotFoundError`` when passed an s3 directory path. (:issue:`26388`)
42+
- Bug in :meth:`~DataFrame.to_parquet` was throwing an ``AttributeError`` when writing a partitioned parquet file to s3 (:issue:`27596`)
43+
- Bug in :meth:`GroupBy.quantile` causes the quantiles to be shifted when the ``by`` axis contains ``NaN`` (:issue:`33200`, :issue:`33569`)
44+
45+
Contributors
46+
~~~~~~~~~~~~
47+
48+
.. contributors:: v1.0.3..v1.0.4|HEAD

0 commit comments

Comments
 (0)