Skip to content

Commit 96043d3

Browse files
committed
Merge remote-tracking branch 'upstream/master' into 26760-converter
2 parents 6f71319 + baa77c3 commit 96043d3

Some content is hidden

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

73 files changed

+712
-317
lines changed

LICENSES/HAVEN_LICENSE

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
YEAR: 2013-2016
2+
COPYRIGHT HOLDER: Hadley Wickham; RStudio; and Evan Miller

LICENSES/HAVEN_MIT

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Based on http://opensource.org/licenses/MIT
2+
3+
This is a template. Complete and ship as file LICENSE the following 2
4+
lines (only)
5+
6+
YEAR:
7+
COPYRIGHT HOLDER:
8+
9+
and specify as
10+
11+
License: MIT + file LICENSE
12+
13+
Copyright (c) <YEAR>, <COPYRIGHT HOLDER>
14+
15+
Permission is hereby granted, free of charge, to any person obtaining
16+
a copy of this software and associated documentation files (the
17+
"Software"), to deal in the Software without restriction, including
18+
without limitation the rights to use, copy, modify, merge, publish,
19+
distribute, sublicense, and/or sell copies of the Software, and to
20+
permit persons to whom the Software is furnished to do so, subject to
21+
the following conditions:
22+
23+
The above copyright notice and this permission notice shall be
24+
included in all copies or substantial portions of the Software.
25+
26+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
30+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
31+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
32+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

asv_bench/benchmarks/sparse.py

+11-19
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import itertools
2-
31
import numpy as np
42
import scipy.sparse
5-
from pandas import (SparseSeries, SparseDataFrame, SparseArray, Series,
6-
date_range, MultiIndex)
3+
4+
import pandas as pd
5+
from pandas import MultiIndex, Series, SparseArray, date_range
76

87

98
def make_array(size, dense_proportion, fill_value, dtype):
@@ -25,10 +24,10 @@ def setup(self):
2524
data = np.random.randn(N)[:-i]
2625
idx = rng[:-i]
2726
data[100:] = np.nan
28-
self.series[i] = SparseSeries(data, index=idx)
27+
self.series[i] = pd.Series(pd.SparseArray(data), index=idx)
2928

3029
def time_series_to_frame(self):
31-
SparseDataFrame(self.series)
30+
pd.DataFrame(self.series)
3231

3332

3433
class SparseArrayConstructor:
@@ -51,16 +50,9 @@ def setup(self):
5150
N = 1000
5251
self.arr = np.arange(N)
5352
self.sparse = scipy.sparse.rand(N, N, 0.005)
54-
self.dict = dict(zip(range(N), itertools.repeat([0])))
55-
56-
def time_constructor(self):
57-
SparseDataFrame(columns=self.arr, index=self.arr)
5853

5954
def time_from_scipy(self):
60-
SparseDataFrame(self.sparse)
61-
62-
def time_from_dict(self):
63-
SparseDataFrame(self.dict)
55+
pd.DataFrame.sparse.from_spmatrix(self.sparse)
6456

6557

6658
class FromCoo:
@@ -71,7 +63,7 @@ def setup(self):
7163
shape=(100, 100))
7264

7365
def time_sparse_series_from_coo(self):
74-
SparseSeries.from_coo(self.matrix)
66+
pd.Series.sparse.from_coo(self.matrix)
7567

7668

7769
class ToCoo:
@@ -82,12 +74,12 @@ def setup(self):
8274
s[100] = -1.0
8375
s[999] = 12.1
8476
s.index = MultiIndex.from_product([range(10)] * 4)
85-
self.ss = s.to_sparse()
77+
self.ss = s.astype("Sparse")
8678

8779
def time_sparse_series_to_coo(self):
88-
self.ss.to_coo(row_levels=[0, 1],
89-
column_levels=[2, 3],
90-
sort_labels=True)
80+
self.ss.sparse.to_coo(row_levels=[0, 1],
81+
column_levels=[2, 3],
82+
sort_labels=True)
9183

9284

9385
class Arithmetic:

azure-pipelines.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ jobs:
55
parameters:
66
name: macOS
77
vmImage: xcode9-macos10.13
8+
89
- template: ci/azure/posix.yml
910
parameters:
1011
name: Linux
@@ -134,7 +135,10 @@ jobs:
134135
- script: |
135136
export PATH=$HOME/miniconda3/bin:$PATH
136137
source activate pandas-dev
137-
doc/make.py
138+
# Next we should simply have `doc/make.py --warnings-are-errors`, everything else is required because the ipython directive doesn't fail the build on errors (https://github.com/ipython/ipython/issues/11547)
139+
doc/make.py --warnings-are-errors | tee sphinx.log ; SPHINX_RET=${PIPESTATUS[0]}
140+
grep -B1 "^<<<-------------------------------------------------------------------------$" sphinx.log ; IPY_RET=$(( $? != 1 ))
141+
exit $(( $SPHINX_RET + $IPY_RET ))
138142
displayName: 'Build documentation'
139143
140144
- script: |

ci/deps/azure-35-compat.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- beautifulsoup4=4.4.1
6+
- beautifulsoup4=4.6.0
77
- bottleneck=1.2.1
88
- jinja2=2.8
99
- numexpr=2.6.2
1010
- numpy=1.13.3
11-
- openpyxl=2.4.0
11+
- openpyxl=2.4.8
1212
- pytables=3.4.2
13-
- python-dateutil=2.5.0
13+
- python-dateutil=2.6.1
1414
- python=3.5.*
15-
- pytz=2015.4
15+
- pytz=2017.2
1616
- scipy=0.19.0
17-
- xlrd=1.0.0
18-
- xlsxwriter=0.7.7
19-
- xlwt=1.0.0
17+
- xlrd=1.1.0
18+
- xlsxwriter=0.9.8
19+
- xlwt=1.2.0
2020
# universal
2121
- cython=0.28.2
2222
- hypothesis>=3.58.0

ci/deps/azure-36-locale.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- beautifulsoup4==4.5.1
6+
- beautifulsoup4==4.6.0
77
- bottleneck=1.2.*
88
- cython=0.28.2
99
- lxml
1010
- matplotlib=2.2.2
1111
- numpy=1.14.*
12-
- openpyxl=2.4.0
12+
- openpyxl=2.4.8
1313
- python-dateutil
1414
- python-blosc
1515
- python=3.6.*
16-
- pytz=2016.10
16+
- pytz=2017.2
1717
- scipy
1818
- sqlalchemy=1.1.4
19-
- xlrd=1.0.0
20-
- xlsxwriter=0.9.4
19+
- xlrd=1.1.0
20+
- xlsxwriter=0.9.8
2121
- xlwt=1.2.0
2222
# universal
2323
- pytest>=4.0.2

ci/deps/azure-macos-35.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ dependencies:
1616
- pyarrow
1717
- pytables
1818
- python=3.5.*
19+
- python-dateutil==2.6.1
1920
- pytz
2021
- xarray
2122
- xlrd
2223
- xlsxwriter
2324
- xlwt
2425
- pip:
25-
- python-dateutil==2.5.3
26+
- pyreadstat
2627
# universal
2728
- pytest==4.5.0
2829
- pytest-xdist

ci/deps/azure-windows-37.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ dependencies:
3030
- pytest-mock
3131
- moto
3232
- hypothesis>=3.58.0
33+
- pyreadstat

ci/deps/travis-37.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ dependencies:
1919
- hypothesis>=3.58.0
2020
- s3fs
2121
- pip
22+
- pyreadstat
2223
- pip:
2324
- moto

doc/source/development/contributing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ You'll need to have at least python3.5 installed on your system.
221221
# Use an ENV_DIR of your choice. We'll use ~/virtualenvs/pandas-dev
222222
# Any parent directories should already exist
223223
python3 -m venv ~/virtualenvs/pandas-dev
224-
# Activate the virtulaenv
224+
# Activate the virtualenv
225225
. ~/virtualenvs/pandas-dev/bin/activate
226226
227227
# Install the build dependencies

doc/source/getting_started/10min.rst

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

doc/source/index.rst.template

+2-4
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ See the :ref:`overview` for more detail about what's in the library.
3838
:maxdepth: 3
3939
:hidden:
4040
{% endif %}
41-
42-
{% if not single_doc -%}
41+
{% if not single_doc %}
4342
What's New in 0.25.0 <whatsnew/v0.25.0>
4443
install
4544
getting_started/index
@@ -52,8 +51,7 @@ See the :ref:`overview` for more detail about what's in the library.
5251
{% if not single_doc -%}
5352
development/index
5453
whatsnew/index
55-
{% endif -%}
56-
54+
{% endif %}
5755

5856
* :doc:`whatsnew/v0.25.0`
5957
* :doc:`install`

doc/source/install.rst

+16-9
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,19 @@ installed), make sure you have `pytest
220220

221221
==================== 12130 passed, 12 skipped in 368.339 seconds =====================
222222

223+
.. _install.dependencies:
224+
223225
Dependencies
224226
------------
225227

226-
* `setuptools <https://setuptools.readthedocs.io/en/latest/>`__: 24.2.0 or higher
227-
* `NumPy <http://www.numpy.org>`__: 1.13.3 or higher
228-
* `python-dateutil <https://dateutil.readthedocs.io/en/stable/>`__: 2.5.0 or higher
229-
* `pytz <http://pytz.sourceforge.net/>`__: 2015.4 or higher
228+
================================================================ ==========================
229+
Package Minimum supported version
230+
================================================================ ==========================
231+
`setuptools <https://setuptools.readthedocs.io/en/latest/>`__ 24.2.0
232+
`NumPy <http://www.numpy.org>`__ 1.13.3
233+
`python-dateutil <https://dateutil.readthedocs.io/en/stable/>`__ 2.6.1
234+
`pytz <http://pytz.sourceforge.net/>`__ 2017.2
235+
================================================================ ==========================
230236

231237
.. _install.recommended_dependencies:
232238

@@ -260,31 +266,32 @@ the method requiring that dependency is called.
260266
========================= ================== =============================================================
261267
Dependency Minimum Version Notes
262268
========================= ================== =============================================================
263-
BeautifulSoup4 4.4.1 HTML parser for read_html (see :ref:`note <optional_html>`)
269+
BeautifulSoup4 4.6.0 HTML parser for read_html (see :ref:`note <optional_html>`)
264270
Jinja2 Conditional formatting with DataFrame.style
265271
PyQt4 Clipboard I/O
266272
PyQt5 Clipboard I/O
267273
PyTables 3.4.2 HDF5-based reading / writing
268274
SQLAlchemy 1.1.4 SQL support for databases other than sqlite
269275
SciPy 0.19.0 Miscellaneous statistical functions
270-
XLsxWriter Excel writing
276+
XLsxWriter 0.9.8 Excel writing
271277
blosc Compression for msgpack
272278
fastparquet 0.2.1 Parquet reading / writing
273279
gcsfs 0.1.0 Google Cloud Storage access
274280
html5lib HTML parser for read_html (see :ref:`note <optional_html>`)
275281
lxml HTML parser for read_html (see :ref:`note <optional_html>`)
276282
matplotlib 2.2.2 Visualization
277-
openpyxl 2.4.0 Reading / writing for xlsx files
283+
openpyxl 2.4.8 Reading / writing for xlsx files
278284
pandas-gbq 0.8.0 Google Big Query access
279285
psycopg2 PostgreSQL engine for sqlalchemy
280286
pyarrow 0.9.0 Parquet and feather reading / writing
281287
pymysql MySQL engine for sqlalchemy
288+
pyreadstat SPSS files (.sav) reading
282289
qtpy Clipboard I/O
283290
s3fs 0.0.8 Amazon S3 access
284291
xarray 0.8.2 pandas-like API for N-dimensional data
285292
xclip Clipboard I/O on linux
286-
xlrd 1.0.0 Excel reading
287-
xlwt 2.4.0 Excel writing
293+
xlrd 1.1.0 Excel reading
294+
xlwt 1.2.0 Excel writing
288295
xsel Clipboard I/O on linux
289296
zlib Compression for msgpack
290297
========================= ================== =============================================================

doc/source/reference/arrays.rst

+29
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ If the data are tz-aware, then every value in the array must have the same timez
144144

145145
.. autosummary::
146146
:toctree: api/
147+
:template: autosummary/class_without_autosummary.rst
147148

148149
arrays.DatetimeArray
149150

@@ -204,6 +205,7 @@ A collection of timedeltas may be stored in a :class:`TimedeltaArray`.
204205

205206
.. autosummary::
206207
:toctree: api/
208+
:template: autosummary/class_without_autosummary.rst
207209

208210
arrays.TimedeltaArray
209211

@@ -263,6 +265,7 @@ Every period in a ``PeriodArray`` must have the same ``freq``.
263265

264266
.. autosummary::
265267
:toctree: api/
268+
:template: autosummary/class_without_autosummary.rst
266269

267270
arrays.PeriodArray
268271

@@ -304,6 +307,7 @@ A collection of intervals may be stored in an :class:`arrays.IntervalArray`.
304307

305308
.. autosummary::
306309
:toctree: api/
310+
:template: autosummary/class_without_autosummary.rst
307311

308312
arrays.IntervalArray
309313

@@ -313,6 +317,29 @@ A collection of intervals may be stored in an :class:`arrays.IntervalArray`.
313317

314318
IntervalDtype
315319

320+
321+
.. Those attributes and methods are included in the API because the docstrings
322+
.. of IntervalIndex and IntervalArray are shared. Including it here to make
323+
.. sure a docstring page is built for them to avoid warnings
324+
325+
..
326+
.. autosummary::
327+
:toctree: api/
328+
329+
arrays.IntervalArray.left
330+
arrays.IntervalArray.right
331+
arrays.IntervalArray.closed
332+
arrays.IntervalArray.mid
333+
arrays.IntervalArray.length
334+
arrays.IntervalArray.is_non_overlapping_monotonic
335+
arrays.IntervalArray.from_arrays
336+
arrays.IntervalArray.from_tuples
337+
arrays.IntervalArray.from_breaks
338+
arrays.IntervalArray.overlaps
339+
arrays.IntervalArray.set_closed
340+
arrays.IntervalArray.to_tuples
341+
342+
316343
.. _api.arrays.integer_na:
317344

318345
Nullable Integer
@@ -323,6 +350,7 @@ Pandas provides this through :class:`arrays.IntegerArray`.
323350

324351
.. autosummary::
325352
:toctree: api/
353+
:template: autosummary/class_without_autosummary.rst
326354

327355
arrays.IntegerArray
328356

@@ -414,6 +442,7 @@ be stored efficiently as a :class:`SparseArray`.
414442

415443
.. autosummary::
416444
:toctree: api/
445+
:template: autosummary/class_without_autosummary.rst
417446

418447
SparseArray
419448

doc/source/reference/extensions.rst

+5
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,9 @@ objects.
1919
api.extensions.register_index_accessor
2020
api.extensions.ExtensionDtype
2121
api.extensions.ExtensionArray
22+
23+
.. autosummary::
24+
:toctree: api/
25+
:template: autosummary/class_without_autosummary.rst
26+
2227
arrays.PandasArray

0 commit comments

Comments
 (0)