Skip to content

Commit ca9a9b4

Browse files
committed
Merge remote-tracking branch 'upstream/master' into pandas-rosy-new
2 parents e99049a + 12bb6d0 commit ca9a9b4

Some content is hidden

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

42 files changed

+1078
-520
lines changed

asv_bench/benchmarks/eval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def setup(self):
4545
index = pd.date_range('20010101', periods=N, freq='T')
4646
s = pd.Series(index)
4747
self.ts = s.iloc[halfway]
48-
self.df = pd.DataFrame({'a': np.random.randn(N), 'dates': s},
48+
self.df = pd.DataFrame({'a': np.random.randn(N), 'dates': index},
4949
index=index)
5050
data = np.random.randn(N)
5151
self.min_val = data.min()

ci/deps/travis-27.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
- patsy
2323
- psycopg2
2424
- py
25-
- pyarrow=0.7.0
25+
- pyarrow=0.9.0
2626
- PyCrypto
2727
- pymysql=0.6.3
2828
- pytables

doc/source/extending.rst

+13
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@ decorate a class, providing the name of attribute to add. The class's
2828
@pd.api.extensions.register_dataframe_accessor("geo")
2929
class GeoAccessor(object):
3030
def __init__(self, pandas_obj):
31+
self._validate(pandas_obj)
3132
self._obj = pandas_obj
3233
34+
@staticmethod
35+
def _validate(obj):
36+
if 'lat' not in obj.columns or 'lon' not in obj.columns:
37+
raise AttributeError("Must have 'lat' and 'lon'.")
38+
3339
@property
3440
def center(self):
3541
# return the geographic center point of this DataFrame
@@ -54,6 +60,13 @@ This can be a convenient way to extend pandas objects without subclassing them.
5460
If you write a custom accessor, make a pull request adding it to our
5561
:ref:`ecosystem` page.
5662

63+
We highly recommend validating the data in your accessor's `__init__`.
64+
In our ``GeoAccessor``, we validate that the data contains the expected columns,
65+
raising an ``AttributeError`` when the validation fails.
66+
For a ``Series`` accessor, you should validate the ``dtype`` if the accessor
67+
applies only to certain dtypes.
68+
69+
5770
.. _extending.extension-types:
5871

5972
Extension Types

doc/source/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ Optional Dependencies
257257
* `SciPy <http://www.scipy.org>`__: miscellaneous statistical functions, Version 0.18.1 or higher
258258
* `xarray <http://xarray.pydata.org>`__: pandas like handling for > 2 dims, needed for converting Panels to xarray objects. Version 0.7.0 or higher is recommended.
259259
* `PyTables <http://www.pytables.org>`__: necessary for HDF5-based storage, Version 3.4.2 or higher
260-
* `pyarrow <http://arrow.apache.org/docs/python/>`__ (>= 0.7.0): necessary for feather-based storage.
260+
* `pyarrow <http://arrow.apache.org/docs/python/>`__ (>= 0.9.0): necessary for feather-based storage.
261261
* `Apache Parquet <https://parquet.apache.org/>`__, either `pyarrow <http://arrow.apache.org/docs/python/>`__ (>= 0.7.0) or `fastparquet <https://fastparquet.readthedocs.io/en/latest>`__ (>= 0.2.1) for parquet-based storage. The `snappy <https://pypi.org/project/python-snappy>`__ and `brotli <https://pypi.org/project/brotlipy>`__ are available for compression support.
262262
* `SQLAlchemy <http://www.sqlalchemy.org>`__: for SQL database support. Version 0.8.1 or higher recommended. Besides SQLAlchemy, you also need a database specific driver. You can find an overview of supported drivers for each SQL dialect in the `SQLAlchemy docs <http://docs.sqlalchemy.org/en/latest/dialects/index.html>`__. Some common drivers are:
263263

doc/source/whatsnew/v0.24.0.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ Pandas 0.24.0 includes a number of API breaking changes.
439439
Dependencies have increased minimum versions
440440
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
441441

442-
We have updated our minimum supported versions of dependencies (:issue:`21242`, :issue:`18742`, :issue:`23774`).
442+
We have updated our minimum supported versions of dependencies (:issue:`21242`, :issue:`18742`, :issue:`23774`, :issue:`24767`).
443443
If installed, we now require:
444444

445445
+-----------------+-----------------+----------+
@@ -457,7 +457,7 @@ If installed, we now require:
457457
+-----------------+-----------------+----------+
458458
| pandas-gbq | 0.8.0 | |
459459
+-----------------+-----------------+----------+
460-
| pyarrow | 0.7.0 | |
460+
| pyarrow | 0.9.0 | |
461461
+-----------------+-----------------+----------+
462462
| pytables | 3.4.2 | |
463463
+-----------------+-----------------+----------+
@@ -1160,6 +1160,7 @@ Other API Changes
11601160
- :meth:`CategoricalIndex.reindex` now raises a ``ValueError`` if the target index is non-unique and not equal to the current index. It previously only raised if the target index was not of a categorical dtype (:issue:`23963`).
11611161
- :func:`Series.to_list` and :func:`Index.to_list` are now aliases of ``Series.tolist`` respectively ``Index.tolist`` (:issue:`8826`)
11621162
- The result of ``SparseSeries.unstack`` is now a :class:`DataFrame` with sparse values, rather than a :class:`SparseDataFrame` (:issue:`24372`).
1163+
- :class:`DatetimeIndex` and :class:`TimedeltaIndex` no longer ignore the dtype precision. Passing a non-nanosecond resolution dtype will raise a ``ValueError`` (:issue:`24753`)
11631164

11641165

11651166
.. _whatsnew_0240.api.extension:
@@ -1260,6 +1261,7 @@ Deprecations
12601261
- :meth:`Series.nonzero` is deprecated and will be removed in a future version (:issue:`18262`)
12611262
- Passing an integer to :meth:`Series.fillna` and :meth:`DataFrame.fillna` with ``timedelta64[ns]`` dtypes is deprecated, will raise ``TypeError`` in a future version. Use ``obj.fillna(pd.Timedelta(...))`` instead (:issue:`24694`)
12621263
- ``Series.cat.categorical``, ``Series.cat.name`` and ``Sersies.cat.index`` have been deprecated. Use the attributes on ``Series.cat`` or ``Series`` directly. (:issue:`24751`).
1264+
- Passing a dtype without a precision like ``np.dtype('datetime64')`` or ``timedelta64`` to :class:`Index`, :class:`DatetimeIndex` and :class:`TimedeltaIndex` is now deprecated. Use the nanosecond-precision dtype instead (:issue:`24753`).
12631265

12641266
.. _whatsnew_0240.deprecations.datetimelike_int_ops:
12651267

@@ -1549,6 +1551,7 @@ Datetimelike
15491551
- Bug in :meth:`DatetimeIndex.astype`, :meth:`PeriodIndex.astype` and :meth:`TimedeltaIndex.astype` ignoring the sign of the ``dtype`` for unsigned integer dtypes (:issue:`24405`).
15501552
- Fixed bug in :meth:`Series.max` with ``datetime64[ns]``-dtype failing to return ``NaT`` when nulls are present and ``skipna=False`` is passed (:issue:`24265`)
15511553
- Bug in :func:`to_datetime` where arrays of ``datetime`` objects containing both timezone-aware and timezone-naive ``datetimes`` would fail to raise ``ValueError`` (:issue:`24569`)
1554+
- Bug in :func:`to_datetime` with invalid datetime format doesn't coerce input to ``NaT`` even if ``errors='coerce'`` (:issue:`24763`)
15521555

15531556
Timedelta
15541557
^^^^^^^^^
@@ -1706,6 +1709,7 @@ I/O
17061709
^^^
17071710

17081711
- Bug in :func:`read_csv` in which a column specified with ``CategoricalDtype`` of boolean categories was not being correctly coerced from string values to booleans (:issue:`20498`)
1712+
- Bug in :func:`read_csv` in which unicode column names were not being properly recognized with Python 2.x (:issue:`13253`)
17091713
- Bug in :meth:`DataFrame.to_sql` when writing timezone aware data (``datetime64[ns, tz]`` dtype) would raise a ``TypeError`` (:issue:`9086`)
17101714
- Bug in :meth:`DataFrame.to_sql` where a naive :class:`DatetimeIndex` would be written as ``TIMESTAMP WITH TIMEZONE`` type in supported databases, e.g. PostgreSQL (:issue:`23510`)
17111715
- Bug in :meth:`read_excel()` when ``parse_cols`` is specified with an empty dataset (:issue:`9208`)

doc/source/whatsnew/v0.24.1.rst

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
:orphan:
2+
3+
.. _whatsnew_0241:
4+
5+
Whats New in 0.24.1 (February XX, 2019)
6+
---------------------------------------
7+
8+
.. warning::
9+
10+
The 0.24.x series of releases will be the last to support Python 2. Future feature
11+
releases will support Python 3 only. See :ref:`install.dropping-27` for more.
12+
13+
{{ header }}
14+
15+
These are the changes in pandas 0.24.1. See :ref:`release` for a full changelog
16+
including other versions of pandas.
17+
18+
19+
.. _whatsnew_0241.enhancements:
20+
21+
Enhancements
22+
^^^^^^^^^^^^
23+
24+
25+
.. _whatsnew_0241.bug_fixes:
26+
27+
Bug Fixes
28+
~~~~~~~~~
29+
30+
**Conversion**
31+
32+
-
33+
-
34+
-
35+
36+
**Indexing**
37+
38+
-
39+
-
40+
-
41+
42+
**I/O**
43+
44+
-
45+
-
46+
-
47+
48+
**Categorical**
49+
50+
-
51+
-
52+
-
53+
54+
**Timezones**
55+
56+
-
57+
-
58+
-
59+
60+
**Timedelta**
61+
62+
-
63+
-
64+
-
65+
66+
67+
**Other**
68+
69+
-
70+
-
71+
72+
.. _whatsnew_0.241.contributors:
73+
74+
Contributors
75+
~~~~~~~~~~~~
76+
77+
.. contributors:: v0.24.0..v0.24.1

doc/source/whatsnew/v0.25.0.rst

+206
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
:orphan:
2+
3+
.. _whatsnew_0250:
4+
5+
What's New in 0.25.0 (April XX, 2019)
6+
-------------------------------------
7+
8+
{{ header }}
9+
10+
These are the changes in pandas 0.25.0. See :ref:`release` for a full changelog
11+
including other versions of pandas.
12+
13+
14+
.. _whatsnew_0250.enhancements.other:
15+
16+
Other Enhancements
17+
^^^^^^^^^^^^^^^^^^
18+
19+
-
20+
-
21+
-
22+
23+
24+
.. _whatsnew_0250.api_breaking:
25+
26+
Backwards incompatible API changes
27+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28+
29+
.. _whatsnew_0250.api.other:
30+
31+
Other API Changes
32+
^^^^^^^^^^^^^^^^^
33+
34+
-
35+
-
36+
-
37+
38+
.. _whatsnew_0250.deprecations:
39+
40+
Deprecations
41+
~~~~~~~~~~~~
42+
43+
-
44+
-
45+
-
46+
47+
48+
.. _whatsnew_0250.prior_deprecations:
49+
50+
Removal of prior version deprecations/changes
51+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52+
53+
-
54+
-
55+
-
56+
57+
.. _whatsnew_0250.performance:
58+
59+
Performance Improvements
60+
~~~~~~~~~~~~~~~~~~~~~~~~
61+
62+
-
63+
-
64+
-
65+
66+
67+
.. _whatsnew_0250.bug_fixes:
68+
69+
Bug Fixes
70+
~~~~~~~~~
71+
72+
Categorical
73+
^^^^^^^^^^^
74+
75+
-
76+
-
77+
-
78+
79+
Datetimelike
80+
^^^^^^^^^^^^
81+
82+
-
83+
-
84+
-
85+
86+
Timedelta
87+
^^^^^^^^^
88+
89+
-
90+
-
91+
-
92+
93+
Timezones
94+
^^^^^^^^^
95+
96+
-
97+
-
98+
-
99+
100+
Numeric
101+
^^^^^^^
102+
103+
-
104+
-
105+
-
106+
107+
108+
Conversion
109+
^^^^^^^^^^
110+
111+
-
112+
-
113+
-
114+
115+
Strings
116+
^^^^^^^
117+
118+
-
119+
-
120+
-
121+
122+
123+
Interval
124+
^^^^^^^^
125+
126+
-
127+
-
128+
-
129+
130+
Indexing
131+
^^^^^^^^
132+
133+
-
134+
-
135+
-
136+
137+
138+
Missing
139+
^^^^^^^
140+
141+
-
142+
-
143+
-
144+
145+
MultiIndex
146+
^^^^^^^^^^
147+
148+
-
149+
-
150+
-
151+
152+
153+
I/O
154+
^^^
155+
156+
-
157+
-
158+
-
159+
160+
161+
Plotting
162+
^^^^^^^^
163+
164+
-
165+
-
166+
-
167+
168+
Groupby/Resample/Rolling
169+
^^^^^^^^^^^^^^^^^^^^^^^^
170+
171+
-
172+
-
173+
-
174+
175+
176+
Reshaping
177+
^^^^^^^^^
178+
179+
-
180+
-
181+
-
182+
183+
184+
Sparse
185+
^^^^^^
186+
187+
-
188+
-
189+
-
190+
191+
192+
Other
193+
^^^^^
194+
195+
-
196+
-
197+
-
198+
199+
200+
.. _whatsnew_0.250.contributors:
201+
202+
Contributors
203+
~~~~~~~~~~~~
204+
205+
.. contributors:: v0.24.x..HEAD
206+

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies:
3939
- nbsphinx
4040
- numexpr>=2.6.8
4141
- openpyxl
42-
- pyarrow>=0.7.0
42+
- pyarrow>=0.9.0
4343
- pytables>=3.4.2
4444
- pytest-cov
4545
- pytest-xdist

0 commit comments

Comments
 (0)