Skip to content

Commit 9ec5917

Browse files
committed
Merge remote-tracking branch 'upstream/master' into remove-panel
2 parents 53abf20 + 46adc5b commit 9ec5917

File tree

107 files changed

+744
-987
lines changed

Some content is hidden

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

107 files changed

+744
-987
lines changed

ci/deps/azure-35-compat.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
- openpyxl=2.4.8
1212
- pytables=3.4.2
1313
- python-dateutil=2.6.1
14-
- python=3.5.*
14+
- python=3.5.3
1515
- pytz=2017.2
1616
- scipy=0.19.0
1717
- xlrd=1.1.0

ci/deps/azure-37-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies:
1010
- jinja2
1111
- lxml
1212
- matplotlib
13+
- moto
1314
- nomkl
1415
- numexpr
1516
- numpy
@@ -32,4 +33,3 @@ dependencies:
3233
- pip
3334
- pip:
3435
- hypothesis>=3.58.0
35-
- moto # latest moto in conda-forge fails with 3.7, move to conda dependencies when this is fixed

ci/deps/azure-windows-37.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies:
1010
- jinja2
1111
- lxml
1212
- matplotlib=2.2.*
13+
- moto
1314
- numexpr
1415
- numpy=1.14.*
1516
- openpyxl
@@ -29,6 +30,5 @@ dependencies:
2930
- pytest-xdist
3031
- pytest-mock
3132
- pytest-azurepipelines
32-
- moto
3333
- hypothesis>=3.58.0
3434
- pyreadstat

ci/deps/travis-36-cov.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dependencies:
1212
- geopandas
1313
- html5lib
1414
- matplotlib
15+
- moto
1516
- nomkl
1617
- numexpr
1718
- numpy=1.15.*
@@ -46,6 +47,5 @@ dependencies:
4647
- pip:
4748
- brotlipy
4849
- coverage
49-
- moto
5050
- pandas-datareader
5151
- python-dateutil

ci/deps/travis-36-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dependencies:
1414
- jinja2
1515
- lxml=3.8.0
1616
- matplotlib=3.0.*
17+
- moto
1718
- nomkl
1819
- numexpr
1920
- numpy
@@ -36,7 +37,6 @@ dependencies:
3637
- pytest>=4.0.2
3738
- pytest-xdist
3839
- pytest-mock
39-
- moto
4040
- pip
4141
- pip:
4242
- hypothesis>=3.58.0

doc/source/development/contributing.rst

-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ We'll now kick off a three-step process:
178178
# Create and activate the build environment
179179
conda env create -f environment.yml
180180
conda activate pandas-dev
181-
conda uninstall --force pandas
182181
183182
# or with older versions of Anaconda:
184183
source activate pandas-dev

doc/source/getting_started/10min.rst

-1
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,6 @@ See the :ref:`Plotting <visualization>` docs.
712712
plt.close('all')
713713
714714
.. ipython:: python
715-
:okwarning:
716715
717716
ts = pd.Series(np.random.randn(1000),
718717
index=pd.date_range('1/1/2000', periods=1000))

doc/source/reference/frame.rst

-2
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ Reindexing / selection / label manipulation
198198
DataFrame.idxmin
199199
DataFrame.last
200200
DataFrame.reindex
201-
DataFrame.reindex_axis
202201
DataFrame.reindex_like
203202
DataFrame.rename
204203
DataFrame.rename_axis
@@ -337,7 +336,6 @@ Serialization / IO / conversion
337336
.. autosummary::
338337
:toctree: api/
339338

340-
DataFrame.from_csv
341339
DataFrame.from_dict
342340
DataFrame.from_items
343341
DataFrame.from_records

doc/source/user_guide/advanced.rst

+11-4
Original file line numberDiff line numberDiff line change
@@ -965,21 +965,26 @@ If you select a label *contained* within an interval, this will also select the
965965
df.loc[2.5]
966966
df.loc[[2.5, 3.5]]
967967
968-
``Interval`` and ``IntervalIndex`` are used by ``cut`` and ``qcut``:
968+
:func:`cut` and :func:`qcut` both return a ``Categorical`` object, and the bins they
969+
create are stored as an ``IntervalIndex`` in its ``.categories`` attribute.
969970

970971
.. ipython:: python
971972
972973
c = pd.cut(range(4), bins=2)
973974
c
974975
c.categories
975976
976-
Furthermore, ``IntervalIndex`` allows one to bin *other* data with these same
977-
bins, with ``NaN`` representing a missing value similar to other dtypes.
977+
:func:`cut` also accepts an ``IntervalIndex`` for its ``bins`` argument, which enables
978+
a useful pandas idiom. First, We call :func:`cut` with some data and ``bins`` set to a
979+
fixed number, to generate the bins. Then, we pass the values of ``.categories`` as the
980+
``bins`` argument in subsequent calls to :func:`cut`, supplying new data which will be
981+
binned into the same bins.
978982

979983
.. ipython:: python
980984
981985
pd.cut([0, 3, 5, 1], bins=c.categories)
982986
987+
Any value which falls outside all bins will be assigned a ``NaN`` value.
983988

984989
Generating ranges of intervals
985990
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1108,6 +1113,8 @@ the :meth:`~Index.is_unique` attribute.
11081113
weakly_monotonic.is_monotonic_increasing
11091114
weakly_monotonic.is_monotonic_increasing & weakly_monotonic.is_unique
11101115
1116+
.. _advanced.endpoints_are_inclusive:
1117+
11111118
Endpoints are inclusive
11121119
~~~~~~~~~~~~~~~~~~~~~~~
11131120

@@ -1137,7 +1144,7 @@ index can be somewhat complicated. For example, the following does not work:
11371144
s.loc['c':'e' + 1]
11381145

11391146
A very common use case is to limit a time series to start and end at two
1140-
specific dates. To enable this, we made the design to make label-based
1147+
specific dates. To enable this, we made the design choice to make label-based
11411148
slicing include both endpoints:
11421149

11431150
.. ipython:: python

doc/source/user_guide/indexing.rst

+6-4
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ of multi-axis indexing.
6161
* A list or array of labels ``['a', 'b', 'c']``.
6262
* A slice object with labels ``'a':'f'`` (Note that contrary to usual python
6363
slices, **both** the start and the stop are included, when present in the
64-
index! See :ref:`Slicing with labels
65-
<indexing.slicing_with_labels>`.).
64+
index! See :ref:`Slicing with labels <indexing.slicing_with_labels>`
65+
and :ref:`Endpoints are inclusive <advanced.endpoints_are_inclusive>`.)
6666
* A boolean array
6767
* A ``callable`` function with one argument (the calling Series or DataFrame) and
6868
that returns valid output for indexing (one of the above).
@@ -335,8 +335,7 @@ The ``.loc`` attribute is the primary access method. The following are valid inp
335335
* A list or array of labels ``['a', 'b', 'c']``.
336336
* A slice object with labels ``'a':'f'`` (Note that contrary to usual python
337337
slices, **both** the start and the stop are included, when present in the
338-
index! See :ref:`Slicing with labels
339-
<indexing.slicing_with_labels>`.).
338+
index! See :ref:`Slicing with labels <indexing.slicing_with_labels>`.
340339
* A boolean array.
341340
* A ``callable``, see :ref:`Selection By Callable <indexing.callable>`.
342341

@@ -418,6 +417,9 @@ error will be raised (since doing otherwise would be computationally expensive,
418417
as well as potentially ambiguous for mixed type indexes). For instance, in the
419418
above example, ``s.loc[1:6]`` would raise ``KeyError``.
420419

420+
For the rationale behind this behavior, see
421+
:ref:`Endpoints are inclusive <advanced.endpoints_are_inclusive>`.
422+
421423
.. _indexing.integer:
422424

423425
Selection by position

doc/source/user_guide/io.rst

+10-13
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,6 @@ dialect : str or :class:`python:csv.Dialect` instance, default ``None``
340340
`skipinitialspace`, `quotechar`, and `quoting`. If it is necessary to
341341
override values, a ParserWarning will be issued. See :class:`python:csv.Dialect`
342342
documentation for more details.
343-
tupleize_cols : boolean, default ``False``
344-
.. deprecated:: 0.21.0
345-
346-
This argument will be removed and will always convert to MultiIndex
347-
348-
Leave a list of tuples on columns as is (default is to convert to a MultiIndex
349-
on the columns).
350343

351344
Error handling
352345
++++++++++++++
@@ -1718,8 +1711,6 @@ function takes a number of arguments. Only the first is required.
17181711
* ``escapechar``: Character used to escape ``sep`` and ``quotechar`` when
17191712
appropriate (default None)
17201713
* ``chunksize``: Number of rows to write at a time
1721-
* ``tupleize_cols``: If False (default), write as a list of tuples, otherwise
1722-
write in an expanded line format suitable for ``read_csv``
17231714
* ``date_format``: Format string for datetime objects
17241715

17251716
Writing a formatted string
@@ -3393,15 +3384,15 @@ both on the writing (serialization), and reading (deserialization).
33933384

33943385
.. warning::
33953386

3396-
This is a very new feature of pandas. We intend to provide certain
3397-
optimizations in the io of the ``msgpack`` data. Since this is marked
3398-
as an EXPERIMENTAL LIBRARY, the storage format may not be stable until a future release.
3387+
The msgpack format is deprecated as of 0.25 and will be removed in a future version.
3388+
It is recommended to use pyarrow for on-the-wire transmission of pandas objects.
33993389

34003390
.. warning::
34013391

34023392
:func:`read_msgpack` is only guaranteed backwards compatible back to pandas version 0.20.3
34033393

34043394
.. ipython:: python
3395+
:okwarning:
34053396
34063397
df = pd.DataFrame(np.random.rand(5, 2), columns=list('AB'))
34073398
df.to_msgpack('foo.msg')
@@ -3411,20 +3402,23 @@ both on the writing (serialization), and reading (deserialization).
34113402
You can pass a list of objects and you will receive them back on deserialization.
34123403

34133404
.. ipython:: python
3405+
:okwarning:
34143406
34153407
pd.to_msgpack('foo.msg', df, 'foo', np.array([1, 2, 3]), s)
34163408
pd.read_msgpack('foo.msg')
34173409
34183410
You can pass ``iterator=True`` to iterate over the unpacked results:
34193411

34203412
.. ipython:: python
3413+
:okwarning:
34213414
34223415
for o in pd.read_msgpack('foo.msg', iterator=True):
34233416
print(o)
34243417
34253418
You can pass ``append=True`` to the writer to append to an existing pack:
34263419

34273420
.. ipython:: python
3421+
:okwarning:
34283422
34293423
df.to_msgpack('foo.msg', append=True)
34303424
pd.read_msgpack('foo.msg')
@@ -3435,6 +3429,7 @@ can pack arbitrary collections of Python lists, dicts, scalars, while intermixin
34353429
pandas objects.
34363430

34373431
.. ipython:: python
3432+
:okwarning:
34383433
34393434
pd.to_msgpack('foo2.msg', {'dict': [{'df': df}, {'string': 'foo'},
34403435
{'scalar': 1.}, {'s': s}]})
@@ -3453,14 +3448,16 @@ Read/write API
34533448
Msgpacks can also be read from and written to strings.
34543449

34553450
.. ipython:: python
3451+
:okwarning:
34563452
34573453
df.to_msgpack()
34583454
34593455
Furthermore you can concatenate the strings to produce a list of the original objects.
34603456

34613457
.. ipython:: python
3458+
:okwarning:
34623459
3463-
pd.read_msgpack(df.to_msgpack() + s.to_msgpack())
3460+
pd.read_msgpack(df.to_msgpack() + s.to_msgpack())
34643461
34653462
.. _io.hdf5:
34663463

doc/source/user_guide/missing_data.rst

-1
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,6 @@ You can mix pandas' ``reindex`` and ``interpolate`` methods to interpolate
458458
at the new values.
459459

460460
.. ipython:: python
461-
:okexcept:
462461
463462
ser = pd.Series(np.sort(np.random.uniform(size=100)))
464463

doc/source/user_guide/timeseries.rst

-10
Original file line numberDiff line numberDiff line change
@@ -474,16 +474,6 @@ resulting ``DatetimeIndex``:
474474
Custom frequency ranges
475475
~~~~~~~~~~~~~~~~~~~~~~~
476476

477-
.. warning::
478-
479-
This functionality was originally exclusive to ``cdate_range``, which is
480-
deprecated as of version 0.21.0 in favor of ``bdate_range``. Note that
481-
``cdate_range`` only utilizes the ``weekmask`` and ``holidays`` parameters
482-
when custom business day, 'C', is passed as the frequency string. Support has
483-
been expanded with ``bdate_range`` to work with any custom frequency string.
484-
485-
.. versionadded:: 0.21.0
486-
487477
``bdate_range`` can also generate a range of custom frequency dates by using
488478
the ``weekmask`` and ``holidays`` parameters. These parameters will only be
489479
used if a custom frequency string is passed.

doc/source/whatsnew/v0.13.0.rst

+2
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ Experimental
829829
Since this is an EXPERIMENTAL LIBRARY, the storage format may not be stable until a future release.
830830

831831
.. ipython:: python
832+
:okwarning:
832833
833834
df = pd.DataFrame(np.random.rand(5, 2), columns=list('AB'))
834835
df.to_msgpack('foo.msg')
@@ -841,6 +842,7 @@ Experimental
841842
You can pass ``iterator=True`` to iterator over the unpacked results
842843

843844
.. ipython:: python
845+
:okwarning:
844846
845847
for o in pd.read_msgpack('foo.msg', iterator=True):
846848
print(o)

doc/source/whatsnew/v0.24.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ Deprecations
12981298
- :meth:`Series.compress` is deprecated. Use ``Series[condition]`` instead (:issue:`18262`)
12991299
- The signature of :meth:`Series.to_csv` has been uniformed to that of :meth:`DataFrame.to_csv`: the name of the first argument is now ``path_or_buf``, the order of subsequent arguments has changed, the ``header`` argument now defaults to ``True``. (:issue:`19715`)
13001300
- :meth:`Categorical.from_codes` has deprecated providing float values for the ``codes`` argument. (:issue:`21767`)
1301-
- :func:`pandas.read_table` is deprecated. Instead, use :func:`read_csv` passing ``sep='\t'`` if necessary (:issue:`21948`)
1301+
- :func:`pandas.read_table` is deprecated. Instead, use :func:`read_csv` passing ``sep='\t'`` if necessary. This deprecation has been removed in 0.25.0. (:issue:`21948`)
13021302
- :meth:`Series.str.cat` has deprecated using arbitrary list-likes *within* list-likes. A list-like container may still contain
13031303
many ``Series``, ``Index`` or 1-dimensional ``np.ndarray``, or alternatively, only scalar values. (:issue:`21950`)
13041304
- :meth:`FrozenNDArray.searchsorted` has deprecated the ``v`` parameter in favor of ``value`` (:issue:`14645`)

0 commit comments

Comments
 (0)