Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 49a2c5f

Browse files
committed
Merge remote-tracking branch 'upstream/master' into dstansby-mpl-convert-cache
2 parents 083e831 + 489d1ff commit 49a2c5f

Some content is hidden

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

64 files changed

+1001
-792
lines changed

ci/deps/azure-37-locale.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
- openpyxl
1818
- pytables
1919
- python-dateutil
20-
- python=3.7.3
20+
- python=3.7.*
2121
- pytz
2222
- s3fs
2323
- scipy

ci/deps/azure-37-numpydev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pandas-dev
22
channels:
33
- defaults
44
dependencies:
5-
- python=3.7.3
5+
- python=3.7.*
66
- pytz
77
- Cython>=0.28.2
88
# universal

ci/deps/travis-37.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
- conda-forge
55
- c3i_test
66
dependencies:
7-
- python=3.7.3
7+
- python=3.7.*
88
- botocore>=1.11
99
- cython>=0.28.2
1010
- numpy

doc/source/user_guide/io.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ The pandas I/O API is a set of top level ``reader`` functions accessed like
2828
:delim: ;
2929

3030
text;`CSV <https://en.wikipedia.org/wiki/Comma-separated_values>`__;:ref:`read_csv<io.read_csv_table>`;:ref:`to_csv<io.store_in_csv>`
31+
text;`TXT <https://www.oracle.com/webfolder/technetwork/data-quality/edqhelp/Content/introduction/getting_started/configuring_fixed_width_text_file_formats.htm>`__;:ref:`read_fwf<io.fwf_reader>`
3132
text;`JSON <https://www.json.org/>`__;:ref:`read_json<io.json_reader>`;:ref:`to_json<io.json_writer>`
3233
text;`HTML <https://en.wikipedia.org/wiki/HTML>`__;:ref:`read_html<io.read_html>`;:ref:`to_html<io.html>`
3334
text; Local clipboard;:ref:`read_clipboard<io.clipboard>`;:ref:`to_clipboard<io.clipboard>`
@@ -1372,6 +1373,7 @@ should pass the ``escapechar`` option:
13721373
print(data)
13731374
pd.read_csv(StringIO(data), escapechar='\\')
13741375
1376+
.. _io.fwf_reader:
13751377
.. _io.fwf:
13761378

13771379
Files with fixed width columns
@@ -3572,7 +3574,7 @@ Closing a Store and using a context manager:
35723574
Read/write API
35733575
''''''''''''''
35743576

3575-
``HDFStore`` supports an top-level API using ``read_hdf`` for reading and ``to_hdf`` for writing,
3577+
``HDFStore`` supports a top-level API using ``read_hdf`` for reading and ``to_hdf`` for writing,
35763578
similar to how ``read_csv`` and ``to_csv`` work.
35773579

35783580
.. ipython:: python
@@ -3687,7 +3689,7 @@ Hierarchical keys
36873689
Keys to a store can be specified as a string. These can be in a
36883690
hierarchical path-name like format (e.g. ``foo/bar/bah``), which will
36893691
generate a hierarchy of sub-stores (or ``Groups`` in PyTables
3690-
parlance). Keys can be specified with out the leading '/' and are **always**
3692+
parlance). Keys can be specified without the leading '/' and are **always**
36913693
absolute (e.g. 'foo' refers to '/foo'). Removal operations can remove
36923694
everything in the sub-store and **below**, so be *careful*.
36933695

@@ -3825,7 +3827,7 @@ data.
38253827

38263828
A query is specified using the ``Term`` class under the hood, as a boolean expression.
38273829

3828-
* ``index`` and ``columns`` are supported indexers of a ``DataFrames``.
3830+
* ``index`` and ``columns`` are supported indexers of ``DataFrames``.
38293831
* if ``data_columns`` are specified, these can be used as additional indexers.
38303832

38313833
Valid comparison operators are:
@@ -3917,7 +3919,7 @@ Use boolean expressions, with in-line function evaluation.
39173919
39183920
store.select('dfq', "index>pd.Timestamp('20130104') & columns=['A', 'B']")
39193921
3920-
Use and inline column reference
3922+
Use inline column reference.
39213923

39223924
.. ipython:: python
39233925
@@ -4593,8 +4595,8 @@ Performance
45934595
write chunksize (default is 50000). This will significantly lower
45944596
your memory usage on writing.
45954597
* You can pass ``expectedrows=<int>`` to the first ``append``,
4596-
to set the TOTAL number of expected rows that ``PyTables`` will
4597-
expected. This will optimize read/write performance.
4598+
to set the TOTAL number of rows that ``PyTables`` will expect.
4599+
This will optimize read/write performance.
45984600
* Duplicate rows can be written to tables, but are filtered out in
45994601
selection (with the last items being selected; thus a table is
46004602
unique on major, minor pairs)

doc/source/whatsnew/v0.25.1.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ Bug fixes
2525
Categorical
2626
^^^^^^^^^^^
2727

28-
-
29-
-
28+
- Bug in :meth:`Categorical.fillna` would replace all values, not just those that are ``NaN`` (:issue:`26215`)
3029
-
3130

3231
Datetimelike
@@ -83,7 +82,7 @@ Indexing
8382
^^^^^^^^
8483

8584
- Bug in partial-string indexing returning a NumPy array rather than a ``Series`` when indexing with a scalar like ``.loc['2015']`` (:issue:`27516`)
86-
- Break reference cycle involving :class:`Index` to allow garbage collection of :class:`Index` objects without running the GC. (:issue:`27585`)
85+
- Break reference cycle involving :class:`Index` and other index classes to allow garbage collection of index objects without running the GC. (:issue:`27585`, :issue:`27840`)
8786
- Fix regression in assigning values to a single column of a DataFrame with a ``MultiIndex`` columns (:issue:`27841`).
8887
-
8988

@@ -103,9 +102,8 @@ MultiIndex
103102

104103
I/O
105104
^^^
106-
107105
- Avoid calling ``S3File.s3`` when reading parquet, as this was removed in s3fs version 0.3.0 (:issue:`27756`)
108-
-
106+
- Better error message when a negative header is passed in :func:`pandas.read_csv` (:issue:`27779`)
109107
-
110108

111109
Plotting
@@ -130,9 +128,9 @@ Reshaping
130128
^^^^^^^^^
131129

132130
- A ``KeyError`` is now raised if ``.unstack()`` is called on a :class:`Series` or :class:`DataFrame` with a flat :class:`Index` passing a name which is not the correct one (:issue:`18303`)
133-
- Bug in :meth:`DataFrame.crosstab` when ``margins`` set to ``True`` and ``normalize`` is not ``False``, an error is raised. (:issue:`27500`)
131+
- Bug in :meth:`DataFrame.crosstab` when ``margins`` set to ``True`` and ``normalize`` is not ``False``, an error is raised. (:issue:`27500`)
134132
- :meth:`DataFrame.join` now suppresses the ``FutureWarning`` when the sort parameter is specified (:issue:`21952`)
135-
-
133+
- Bug in :meth:`DataFrame.join` raising with readonly arrays (:issue:`27943`)
136134

137135
Sparse
138136
^^^^^^
@@ -163,6 +161,14 @@ Other
163161
-
164162
-
165163

164+
I/O and LZMA
165+
~~~~~~~~~~~~
166+
167+
Some users may unknowingly have an incomplete Python installation, which lacks the `lzma` module from the standard library. In this case, `import pandas` failed due to an `ImportError` (:issue: `27575`).
168+
Pandas will now warn, rather than raising an `ImportError` if the `lzma` module is not present. Any subsequent attempt to use `lzma` methods will raise a `RuntimeError`.
169+
A possible fix for the lack of the `lzma` module is to ensure you have the necessary libraries and then re-install Python.
170+
For example, on MacOS installing Python with `pyenv` may lead to an incomplete Python installation due to unmet system dependencies at compilation time (like `xz`). Compilation will succeed, but Python might fail at run time. The issue can be solved by installing the necessary dependencies and then re-installing Python.
171+
166172
.. _whatsnew_0.251.contributors:
167173

168174
Contributors

doc/source/whatsnew/v0.7.3.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ New features
2525
from pandas.tools.plotting import scatter_matrix
2626
scatter_matrix(df, alpha=0.2) # noqa F821
2727
28-
.. image:: ../savefig/scatter_matrix_kde.png
29-
:width: 5in
3028
3129
- Add ``stacked`` argument to Series and DataFrame's ``plot`` method for
3230
:ref:`stacked bar plots <visualization.barplot>`.
@@ -35,15 +33,11 @@ New features
3533
3634
df.plot(kind='bar', stacked=True) # noqa F821
3735
38-
.. image:: ../savefig/bar_plot_stacked_ex.png
39-
:width: 4in
4036
4137
.. code-block:: python
4238
4339
df.plot(kind='barh', stacked=True) # noqa F821
4440
45-
.. image:: ../savefig/barh_plot_stacked_ex.png
46-
:width: 4in
4741
4842
- Add log x and y :ref:`scaling options <visualization.basic>` to
4943
``DataFrame.plot`` and ``Series.plot``

doc/source/whatsnew/v1.0.0.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,27 @@ including other versions of pandas.
2121
Enhancements
2222
~~~~~~~~~~~~
2323

24-
.. _whatsnew_1000.enhancements.other:
25-
2624
-
2725
-
2826

27+
.. _whatsnew_1000.enhancements.other:
28+
2929
Other enhancements
3030
^^^^^^^^^^^^^^^^^^
3131

32-
.. _whatsnew_1000.api_breaking:
33-
3432
-
3533
-
3634

35+
.. _whatsnew_1000.api_breaking:
36+
3737
Backwards incompatible API changes
3838
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3939

40-
.. _whatsnew_1000.api.other:
41-
4240
- :class:`pandas.core.groupby.GroupBy.transform` now raises on invalid operation names (:issue:`27489`).
4341
-
4442

43+
.. _whatsnew_1000.api.other:
44+
4545
Other API changes
4646
^^^^^^^^^^^^^^^^^
4747

@@ -87,6 +87,7 @@ Bug fixes
8787
Categorical
8888
^^^^^^^^^^^
8989

90+
- Added test to assert the :func:`fillna` raises the correct ValueError message when the value isn't a value from categories (:issue:`13628`)
9091
-
9192
-
9293

@@ -157,14 +158,15 @@ MultiIndex
157158
I/O
158159
^^^
159160

160-
-
161+
- :meth:`read_csv` now accepts binary mode file buffers when using the Python csv engine (:issue:`23779`)
161162
-
162163

163164
Plotting
164165
^^^^^^^^
165166

166167
- Bug in :meth:`Series.plot` not able to plot boolean values (:issue:`23719`)
167168
-
169+
- Bug in :meth:`DataFrame.plot` producing incorrect legend markers when plotting multiple series on the same axis (:issue:`18222`)
168170
- Bug in :meth:`DataFrame.plot` when ``kind='box'`` and data contains datetime or timedelta data. These types are now automatically dropped (:issue:`22799`)
169171

170172
Groupby/resample/rolling

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ channels:
55
dependencies:
66
# required
77
- numpy>=1.15
8-
- python=3.7.3
8+
- python=3
99
- python-dateutil>=2.6.1
1010
- pytz
1111

pandas/_libs/hashtable.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ cdef class Int64Factorizer:
108108
def get_count(self):
109109
return self.count
110110

111-
def factorize(self, int64_t[:] values, sort=False,
111+
def factorize(self, const int64_t[:] values, sort=False,
112112
na_sentinel=-1, na_value=None):
113113
"""
114114
Factorize values with nans replaced by na_sentinel

pandas/_libs/parsers.pyx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# See LICENSE for the license
33
import bz2
44
import gzip
5-
import lzma
65
import os
76
import sys
87
import time
@@ -59,9 +58,12 @@ from pandas.core.arrays import Categorical
5958
from pandas.core.dtypes.concat import union_categoricals
6059
import pandas.io.common as icom
6160

61+
from pandas.compat import _import_lzma, _get_lzma_file
6262
from pandas.errors import (ParserError, DtypeWarning,
6363
EmptyDataError, ParserWarning)
6464

65+
lzma = _import_lzma()
66+
6567
# Import CParserError as alias of ParserError for backwards compatibility.
6668
# Ultimately, we want to remove this import. See gh-12665 and gh-14479.
6769
CParserError = ParserError
@@ -645,9 +647,9 @@ cdef class TextReader:
645647
'zip file %s', str(zip_names))
646648
elif self.compression == 'xz':
647649
if isinstance(source, str):
648-
source = lzma.LZMAFile(source, 'rb')
650+
source = _get_lzma_file(lzma)(source, 'rb')
649651
else:
650-
source = lzma.LZMAFile(filename=source)
652+
source = _get_lzma_file(lzma)(filename=source)
651653
else:
652654
raise ValueError('Unrecognized compression type: %s' %
653655
self.compression)

0 commit comments

Comments
 (0)