Skip to content

Commit 71e8a6b

Browse files
committed
Merge remote-tracking branch 'upstream/master' into readjson-lines-chunks
2 parents 1b6e0d8 + 7d0ee96 commit 71e8a6b

File tree

33 files changed

+305
-83
lines changed

33 files changed

+305
-83
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ matrix:
6969
env:
7070
- JOB="3.7, arm64" PYTEST_WORKERS=8 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard)"
7171
- dist: bionic
72-
python: 3.9-dev
7372
env:
74-
- JOB="3.9-dev" PATTERN="(not slow and not network)"
73+
- JOB="3.9-dev" PATTERN="(not slow and not network and not clipboard)"
74+
7575

7676
before_install:
7777
- echo "before_install"

doc/redirects.csv

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,11 @@ generated/pandas.core.resample.Resampler.std,../reference/api/pandas.core.resamp
269269
generated/pandas.core.resample.Resampler.sum,../reference/api/pandas.core.resample.Resampler.sum
270270
generated/pandas.core.resample.Resampler.transform,../reference/api/pandas.core.resample.Resampler.transform
271271
generated/pandas.core.resample.Resampler.var,../reference/api/pandas.core.resample.Resampler.var
272-
generated/pandas.core.window.EWM.corr,../reference/api/pandas.core.window.EWM.corr
273-
generated/pandas.core.window.EWM.cov,../reference/api/pandas.core.window.EWM.cov
274-
generated/pandas.core.window.EWM.mean,../reference/api/pandas.core.window.EWM.mean
275-
generated/pandas.core.window.EWM.std,../reference/api/pandas.core.window.EWM.std
276-
generated/pandas.core.window.EWM.var,../reference/api/pandas.core.window.EWM.var
272+
generated/pandas.core.window.ExponentialMovingWindow.corr,../reference/api/pandas.core.window.ExponentialMovingWindow.corr
273+
generated/pandas.core.window.ExponentialMovingWindow.cov,../reference/api/pandas.core.window.ExponentialMovingWindow.cov
274+
generated/pandas.core.window.ExponentialMovingWindow.mean,../reference/api/pandas.core.window.ExponentialMovingWindow.mean
275+
generated/pandas.core.window.ExponentialMovingWindow.std,../reference/api/pandas.core.window.ExponentialMovingWindow.std
276+
generated/pandas.core.window.ExponentialMovingWindow.var,../reference/api/pandas.core.window.ExponentialMovingWindow.var
277277
generated/pandas.core.window.Expanding.aggregate,../reference/api/pandas.core.window.Expanding.aggregate
278278
generated/pandas.core.window.Expanding.apply,../reference/api/pandas.core.window.Expanding.apply
279279
generated/pandas.core.window.Expanding.corr,../reference/api/pandas.core.window.Expanding.corr

doc/source/reference/window.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Window
88

99
Rolling objects are returned by ``.rolling`` calls: :func:`pandas.DataFrame.rolling`, :func:`pandas.Series.rolling`, etc.
1010
Expanding objects are returned by ``.expanding`` calls: :func:`pandas.DataFrame.expanding`, :func:`pandas.Series.expanding`, etc.
11-
EWM objects are returned by ``.ewm`` calls: :func:`pandas.DataFrame.ewm`, :func:`pandas.Series.ewm`, etc.
11+
ExponentialMovingWindow objects are returned by ``.ewm`` calls: :func:`pandas.DataFrame.ewm`, :func:`pandas.Series.ewm`, etc.
1212

1313
Standard moving window functions
1414
--------------------------------
@@ -69,11 +69,11 @@ Exponentially-weighted moving window functions
6969
.. autosummary::
7070
:toctree: api/
7171

72-
EWM.mean
73-
EWM.std
74-
EWM.var
75-
EWM.corr
76-
EWM.cov
72+
ExponentialMovingWindow.mean
73+
ExponentialMovingWindow.std
74+
ExponentialMovingWindow.var
75+
ExponentialMovingWindow.corr
76+
ExponentialMovingWindow.cov
7777

7878
Window indexer
7979
--------------

doc/source/user_guide/computation.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ see the :ref:`groupby docs <groupby.transform.window_resample>`.
230230
The API for window statistics is quite similar to the way one works with ``GroupBy`` objects, see the documentation :ref:`here <groupby>`.
231231

232232
We work with ``rolling``, ``expanding`` and ``exponentially weighted`` data through the corresponding
233-
objects, :class:`~pandas.core.window.Rolling`, :class:`~pandas.core.window.Expanding` and :class:`~pandas.core.window.EWM`.
233+
objects, :class:`~pandas.core.window.Rolling`, :class:`~pandas.core.window.Expanding` and :class:`~pandas.core.window.ExponentialMovingWindow`.
234234

235235
.. ipython:: python
236236
@@ -777,7 +777,7 @@ columns by reshaping and indexing:
777777
Aggregation
778778
-----------
779779

780-
Once the ``Rolling``, ``Expanding`` or ``EWM`` objects have been created, several methods are available to
780+
Once the ``Rolling``, ``Expanding`` or ``ExponentialMovingWindow`` objects have been created, several methods are available to
781781
perform multiple computations on the data. These operations are similar to the :ref:`aggregating API <basics.aggregate>`,
782782
:ref:`groupby API <groupby.aggregate>`, and :ref:`resample API <timeseries.aggregate>`.
783783

@@ -971,7 +971,7 @@ Exponentially weighted windows
971971

972972
A related set of functions are exponentially weighted versions of several of
973973
the above statistics. A similar interface to ``.rolling`` and ``.expanding`` is accessed
974-
through the ``.ewm`` method to receive an :class:`~EWM` object.
974+
through the ``.ewm`` method to receive an :class:`~ExponentialMovingWindow` object.
975975
A number of expanding EW (exponentially weighted)
976976
methods are provided:
977977

@@ -980,11 +980,11 @@ methods are provided:
980980
:header: "Function", "Description"
981981
:widths: 20, 80
982982

983-
:meth:`~EWM.mean`, EW moving average
984-
:meth:`~EWM.var`, EW moving variance
985-
:meth:`~EWM.std`, EW moving standard deviation
986-
:meth:`~EWM.corr`, EW moving correlation
987-
:meth:`~EWM.cov`, EW moving covariance
983+
:meth:`~ExponentialMovingWindow.mean`, EW moving average
984+
:meth:`~ExponentialMovingWindow.var`, EW moving variance
985+
:meth:`~ExponentialMovingWindow.std`, EW moving standard deviation
986+
:meth:`~ExponentialMovingWindow.corr`, EW moving correlation
987+
:meth:`~ExponentialMovingWindow.cov`, EW moving covariance
988988

989989
In general, a weighted moving average is calculated as
990990

@@ -1090,12 +1090,12 @@ Here is an example for a univariate time series:
10901090
@savefig ewma_ex.png
10911091
s.ewm(span=20).mean().plot(style='k')
10921092
1093-
EWM has a ``min_periods`` argument, which has the same
1093+
ExponentialMovingWindow has a ``min_periods`` argument, which has the same
10941094
meaning it does for all the ``.expanding`` and ``.rolling`` methods:
10951095
no output values will be set until at least ``min_periods`` non-null values
10961096
are encountered in the (expanding) window.
10971097

1098-
EWM also has an ``ignore_na`` argument, which determines how
1098+
ExponentialMovingWindow also has an ``ignore_na`` argument, which determines how
10991099
intermediate null values affect the calculation of the weights.
11001100
When ``ignore_na=False`` (the default), weights are calculated based on absolute
11011101
positions, so that intermediate null values affect the result.

doc/source/user_guide/cookbook.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,25 @@ Storing Attributes to a group node
11661166
store.close()
11671167
os.remove('test.h5')
11681168
1169+
You can create or load a HDFStore in-memory by passing the ``driver``
1170+
parameter to PyTables. Changes are only written to disk when the HDFStore
1171+
is closed.
1172+
1173+
.. ipython:: python
1174+
1175+
store = pd.HDFStore('test.h5', 'w', diver='H5FD_CORE')
1176+
1177+
df = pd.DataFrame(np.random.randn(8, 3))
1178+
store['test'] = df
1179+
1180+
# only after closing the store, data is written to disk:
1181+
store.close()
1182+
1183+
.. ipython:: python
1184+
:suppress:
1185+
1186+
os.remove('test.h5')
1187+
11691188
.. _cookbook.binary:
11701189

11711190
Binary files

doc/source/user_guide/enhancingperf.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ when we use Cython and Numba on a test function operating row-wise on the
1313
``DataFrame``. Using :func:`pandas.eval` we will speed up a sum by an order of
1414
~2.
1515

16+
.. note::
17+
18+
In addition to following the steps in this tutorial, users interested in enhancing
19+
performance are highly encouraged to install the
20+
:ref:`recommended dependencies<install.recommended_dependencies>` for pandas.
21+
These dependencies are often not installed by default, but will offer speed
22+
improvements if present.
23+
1624
.. _enhancingperf.cython:
1725

1826
Cython (writing C extensions for pandas)

doc/source/user_guide/timeseries.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ inferred frequency upon creation:
235235
236236
pd.DatetimeIndex(['2018-01-01', '2018-01-03', '2018-01-05'], freq='infer')
237237
238+
.. _timeseries.converting.format:
239+
238240
Providing a format argument
239241
~~~~~~~~~~~~~~~~~~~~~~~~~~~
240242

@@ -319,6 +321,12 @@ which can be specified. These are computed from the starting point specified by
319321
pd.to_datetime([1349720105100, 1349720105200, 1349720105300,
320322
1349720105400, 1349720105500], unit='ms')
321323
324+
.. note::
325+
326+
The ``unit`` parameter does not use the same strings as the ``format`` parameter
327+
that was discussed :ref:`above<timeseries.converting.format>`). The
328+
available units are listed on the documentation for :func:`pandas.to_datetime`.
329+
322330
Constructing a :class:`Timestamp` or :class:`DatetimeIndex` with an epoch timestamp
323331
with the ``tz`` argument specified will currently localize the epoch timestamps to UTC
324332
first then convert the result to the specified time zone. However, this behavior

doc/source/user_guide/visualization.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,8 @@ Faceting, created by ``DataFrame.boxplot`` with the ``by``
443443
keyword, will affect the output type as well:
444444

445445
================ ======= ==========================
446-
``return_type=`` Faceted Output type
447-
---------------- ------- --------------------------
448-
446+
``return_type`` Faceted Output type
447+
================ ======= ==========================
449448
``None`` No axes
450449
``None`` Yes 2-D ndarray of axes
451450
``'axes'`` No axes
@@ -1424,7 +1423,7 @@ Here is an example of one way to easily plot group means with standard deviation
14241423
# Plot
14251424
fig, ax = plt.subplots()
14261425
@savefig errorbar_example.png
1427-
means.plot.bar(yerr=errors, ax=ax, capsize=4)
1426+
means.plot.bar(yerr=errors, ax=ax, capsize=4, rot=0)
14281427
14291428
.. ipython:: python
14301429
:suppress:
@@ -1445,9 +1444,9 @@ Plotting with matplotlib table is now supported in :meth:`DataFrame.plot` and :
14451444
14461445
.. ipython:: python
14471446
1448-
fig, ax = plt.subplots(1, 1)
1447+
fig, ax = plt.subplots(1, 1, figsize=(7, 6.5))
14491448
df = pd.DataFrame(np.random.rand(5, 3), columns=['a', 'b', 'c'])
1450-
ax.get_xaxis().set_visible(False) # Hide Ticks
1449+
ax.xaxis.tick_top() # Display x-axis ticks on top.
14511450
14521451
@savefig line_plot_table_true.png
14531452
df.plot(table=True, ax=ax)
@@ -1464,8 +1463,9 @@ as seen in the example below.
14641463

14651464
.. ipython:: python
14661465
1467-
fig, ax = plt.subplots(1, 1)
1468-
ax.get_xaxis().set_visible(False) # Hide Ticks
1466+
fig, ax = plt.subplots(1, 1, figsize=(7, 6.75))
1467+
ax.xaxis.tick_top() # Display x-axis ticks on top.
1468+
14691469
@savefig line_plot_table_data.png
14701470
df.plot(table=np.round(df.T, 2), ax=ax)
14711471

doc/source/whatsnew/v0.25.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ Groupby/resample/rolling
12061206
- Bug in :meth:`pandas.core.groupby.GroupBy.agg` where incorrect results are returned for uint64 columns. (:issue:`26310`)
12071207
- Bug in :meth:`pandas.core.window.Rolling.median` and :meth:`pandas.core.window.Rolling.quantile` where MemoryError is raised with empty window (:issue:`26005`)
12081208
- Bug in :meth:`pandas.core.window.Rolling.median` and :meth:`pandas.core.window.Rolling.quantile` where incorrect results are returned with ``closed='left'`` and ``closed='neither'`` (:issue:`26005`)
1209-
- Improved :class:`pandas.core.window.Rolling`, :class:`pandas.core.window.Window` and :class:`pandas.core.window.EWM` functions to exclude nuisance columns from results instead of raising errors and raise a ``DataError`` only if all columns are nuisance (:issue:`12537`)
1209+
- Improved :class:`pandas.core.window.Rolling`, :class:`pandas.core.window.Window` and :class:`pandas.core.window.ExponentialMovingWindow` functions to exclude nuisance columns from results instead of raising errors and raise a ``DataError`` only if all columns are nuisance (:issue:`12537`)
12101210
- Bug in :meth:`pandas.core.window.Rolling.max` and :meth:`pandas.core.window.Rolling.min` where incorrect results are returned with an empty variable window (:issue:`26005`)
12111211
- Raise a helpful exception when an unsupported weighted window function is used as an argument of :meth:`pandas.core.window.Window.aggregate` (:issue:`26597`)
12121212

doc/source/whatsnew/v1.1.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,7 @@ MultiIndex
956956
df.loc[(['b', 'a'], [2, 1]), :]
957957
958958
- Bug in :meth:`MultiIndex.intersection` was not guaranteed to preserve order when ``sort=False``. (:issue:`31325`)
959+
- Bug in :meth:`DataFrame.truncate` was dropping :class:`MultiIndex` names. (:issue:`34564`)
959960

960961
.. ipython:: python
961962
@@ -1059,6 +1060,7 @@ Reshaping
10591060
- Bug in :func:`Dataframe.aggregate` and :func:`Series.aggregate` was causing recursive loop in some cases (:issue:`34224`)
10601061
- Fixed bug in :func:`melt` where melting MultiIndex columns with ``col_level`` > 0 would raise a ``KeyError`` on ``id_vars`` (:issue:`34129`)
10611062
- Bug in :meth:`Series.where` with an empty Series and empty ``cond`` having non-bool dtype (:issue:`34592`)
1063+
- Fixed regression where :meth:`DataFrame.apply` would raise ``ValueError`` for elements whth ``S`` dtype (:issue:`34529`)
10621064

10631065
Sparse
10641066
^^^^^^

0 commit comments

Comments
 (0)