Skip to content

Commit 7323212

Browse files
committed
Merge branch 'master' into Union2TypeVar
2 parents 9821eed + 891a419 commit 7323212

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

+1390
-944
lines changed

asv_bench/benchmarks/index_object.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def time_is_dates_only(self):
5252

5353
class Ops:
5454

55-
sample_time = 0.2
5655
params = ['float', 'int']
5756
param_names = ['dtype']
5857

@@ -95,6 +94,12 @@ def time_min(self):
9594
def time_min_trivial(self):
9695
self.idx_inc.min()
9796

97+
def time_get_loc_inc(self):
98+
self.idx_inc.get_loc(900000)
99+
100+
def time_get_loc_dec(self):
101+
self.idx_dec.get_loc(100000)
102+
98103

99104
class IndexAppend:
100105

asv_bench/benchmarks/rolling.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
class Methods:
66

7-
sample_time = 0.2
87
params = (['DataFrame', 'Series'],
98
[10, 1000],
109
['int', 'float'],
@@ -23,7 +22,6 @@ def time_rolling(self, constructor, window, dtype, method):
2322

2423
class ExpandingMethods:
2524

26-
sample_time = 0.2
2725
params = (['DataFrame', 'Series'],
2826
['int', 'float'],
2927
['median', 'mean', 'max', 'min', 'std', 'count', 'skew', 'kurt',
@@ -41,7 +39,6 @@ def time_expanding(self, constructor, dtype, method):
4139

4240
class EWMMethods:
4341

44-
sample_time = 0.2
4542
params = (['DataFrame', 'Series'],
4643
[10, 1000],
4744
['int', 'float'],
@@ -58,7 +55,6 @@ def time_ewm(self, constructor, window, dtype, method):
5855

5956

6057
class VariableWindowMethods(Methods):
61-
sample_time = 0.2
6258
params = (['DataFrame', 'Series'],
6359
['50s', '1h', '1d'],
6460
['int', 'float'],
@@ -75,7 +71,6 @@ def setup(self, constructor, window, dtype, method):
7571

7672
class Pairwise:
7773

78-
sample_time = 0.2
7974
params = ([10, 1000, None],
8075
['corr', 'cov'],
8176
[True, False])
@@ -95,7 +90,6 @@ def time_pairwise(self, window, method, pairwise):
9590

9691

9792
class Quantile:
98-
sample_time = 0.2
9993
params = (['DataFrame', 'Series'],
10094
[10, 1000],
10195
['int', 'float'],

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
name: Windows
1616
vmImage: vs2017-win2016
1717

18-
- job: 'Checks_and_doc'
18+
- job: 'Checks'
1919
pool:
2020
vmImage: ubuntu-16.04
2121
timeoutInMinutes: 90

ci/deps/azure-35-compat.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ dependencies:
2626
- pip
2727
- pip:
2828
# for python 3.5, pytest>=4.0.2 is not available in conda
29-
- pytest>=4.0.2
29+
- pytest==4.5.0
3030
- html5lib==1.0b2

ci/deps/azure-macos-35.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies:
2525
- pip:
2626
- python-dateutil==2.5.3
2727
# universal
28-
- pytest>=4.0.2
28+
- pytest==4.5.0
2929
- pytest-xdist
3030
- pytest-mock
3131
- hypothesis>=3.58.0

doc/source/ecosystem.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,4 +363,5 @@ Library Accessor Classes
363363
============== ========== =========================
364364

365365
.. _cyberpandas: https://cyberpandas.readthedocs.io/en/latest
366-
.. _pdvega: https://jakevdp.github.io/pdvega/
366+
.. _pdvega: https://altair-viz.github.io/pdvega/
367+

doc/source/getting_started/basics.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,9 +1455,8 @@ Iteration
14551455

14561456
The behavior of basic iteration over pandas objects depends on the type.
14571457
When iterating over a Series, it is regarded as array-like, and basic iteration
1458-
produces the values. Other data structures, like DataFrame,
1459-
follow the dict-like convention of iterating over the "keys" of the
1460-
objects.
1458+
produces the values. DataFrames follow the dict-like convention of iterating
1459+
over the "keys" of the objects.
14611460

14621461
In short, basic iteration (``for i in object``) produces:
14631462

@@ -1537,9 +1536,9 @@ For example:
15371536

15381537
.. ipython:: python
15391538
1540-
for item, frame in df.iteritems():
1541-
print(item)
1542-
print(frame)
1539+
for label, ser in df.iteritems():
1540+
print(label)
1541+
print(ser)
15431542
15441543
.. _basics.iterrows:
15451544

doc/source/install.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ Optional Dependencies
281281
`qtpy <https://github.com/spyder-ide/qtpy>`__ (requires PyQt or PySide),
282282
`PyQt5 <https://www.riverbankcomputing.com/software/pyqt/download5>`__,
283283
`PyQt4 <http://www.riverbankcomputing.com/software/pyqt/download>`__,
284-
`pygtk <http://www.pygtk.org/>`__,
285284
`xsel <http://www.vergenet.net/~conrad/software/xsel/>`__, or
286285
`xclip <https://github.com/astrand/xclip/>`__: necessary to use
287286
:func:`~pandas.read_clipboard`. Most package managers on Linux distributions will have ``xclip`` and/or ``xsel`` immediately available for installation.

doc/source/reference/frame.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ Conversion
4848
:toctree: api/
4949

5050
DataFrame.astype
51-
DataFrame.convert_objects
5251
DataFrame.infer_objects
5352
DataFrame.copy
5453
DataFrame.isna
@@ -205,7 +204,6 @@ Reindexing / Selection / Label manipulation
205204
DataFrame.rename_axis
206205
DataFrame.reset_index
207206
DataFrame.sample
208-
DataFrame.select
209207
DataFrame.set_axis
210208
DataFrame.set_index
211209
DataFrame.tail

doc/source/reference/series.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ Conversion
5656

5757
Series.astype
5858
Series.infer_objects
59-
Series.convert_objects
6059
Series.copy
6160
Series.bool
6261
Series.to_numpy
@@ -212,7 +211,6 @@ Reindexing / Selection / Label manipulation
212211
Series.rename_axis
213212
Series.reset_index
214213
Series.sample
215-
Series.select
216214
Series.set_axis
217215
Series.take
218216
Series.tail

doc/source/user_guide/io.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3272,7 +3272,7 @@ We can see that we got the same content back, which we had earlier written to th
32723272

32733273
.. note::
32743274

3275-
You may need to install xclip or xsel (with gtk, PyQt5, PyQt4 or qtpy) on Linux to use these methods.
3275+
You may need to install xclip or xsel (with PyQt5, PyQt4 or qtpy) on Linux to use these methods.
32763276

32773277
.. _io.pickle:
32783278

doc/source/user_guide/sparse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ have no replacement.
269269
Interaction with scipy.sparse
270270
-----------------------------
271271

272-
Use :meth:`DataFrame.sparse.from_coo` to create a ``DataFrame`` with sparse values from a sparse matrix.
272+
Use :meth:`DataFrame.sparse.from_spmatrix` to create a ``DataFrame`` with sparse values from a sparse matrix.
273273

274274
.. versionadded:: 0.25.0
275275

doc/source/user_guide/text.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ and replacing any remaining whitespaces with underscores:
7070
``.str`` methods which operate on elements of type ``list`` are not available on such a
7171
``Series``.
7272

73+
.. _text.warn_types:
74+
75+
.. warning::
76+
77+
Before v.0.25.0, the ``.str``-accessor did only the most rudimentary type checks. Starting with
78+
v.0.25.0, the type of the Series is inferred and the allowed types (i.e. strings) are enforced more rigorously.
79+
80+
Generally speaking, the ``.str`` accessor is intended to work only on strings. With very few
81+
exceptions, other uses are not supported, and may be disabled at a later point.
82+
7383

7484
Splitting and Replacing Strings
7585
-------------------------------

doc/source/whatsnew/v0.16.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Interaction with scipy.sparse
9292
Added :meth:`SparseSeries.to_coo` and :meth:`SparseSeries.from_coo` methods (:issue:`8048`) for converting to and from ``scipy.sparse.coo_matrix`` instances (see :ref:`here <sparse.scipysparse>`). For example, given a SparseSeries with MultiIndex we can convert to a `scipy.sparse.coo_matrix` by specifying the row and column labels as index levels:
9393

9494
.. ipython:: python
95+
:okwarning:
9596
9697
s = pd.Series([3.0, np.nan, 1.0, 3.0, np.nan, np.nan])
9798
s.index = pd.MultiIndex.from_tuples([(1, 2, 'a', 0),
@@ -121,6 +122,7 @@ The from_coo method is a convenience method for creating a ``SparseSeries``
121122
from a ``scipy.sparse.coo_matrix``:
122123

123124
.. ipython:: python
125+
:okwarning:
124126
125127
from scipy import sparse
126128
A = sparse.coo_matrix(([3.0, 1.0, 2.0], ([1, 0, 0], [0, 2, 3])),

doc/source/whatsnew/v0.18.1.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ used in the ``pandas`` implementation (:issue:`12644`, :issue:`12638`, :issue:`1
394394
An example of this signature augmentation is illustrated below:
395395

396396
.. ipython:: python
397+
:okwarning:
397398
398399
sp = pd.SparseDataFrame([1, 2, 3])
399400
sp
@@ -409,6 +410,7 @@ Previous behaviour:
409410
New behaviour:
410411

411412
.. ipython:: python
413+
:okwarning:
412414
413415
np.cumsum(sp, axis=0)
414416

doc/source/whatsnew/v0.19.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,6 +1236,7 @@ Operators now preserve dtypes
12361236
- Sparse data structure now can preserve ``dtype`` after arithmetic ops (:issue:`13848`)
12371237

12381238
.. ipython:: python
1239+
:okwarning:
12391240
12401241
s = pd.SparseSeries([0, 2, 0, 1], fill_value=0, dtype=np.int64)
12411242
s.dtype
@@ -1245,6 +1246,7 @@ Operators now preserve dtypes
12451246
- Sparse data structure now support ``astype`` to convert internal ``dtype`` (:issue:`13900`)
12461247

12471248
.. ipython:: python
1249+
:okwarning:
12481250
12491251
s = pd.SparseSeries([1., 0., 2., 0.], fill_value=0)
12501252
s

doc/source/whatsnew/v0.20.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ See the :ref:`documentation <sparse.scipysparse>` for more information. (:issue:
339339
All sparse formats are supported, but matrices that are not in :mod:`COOrdinate <scipy.sparse>` format will be converted, copying data as needed.
340340

341341
.. ipython:: python
342+
:okwarning:
342343
343344
from scipy.sparse import csr_matrix
344345
arr = np.random.random(size=(1000, 5))

0 commit comments

Comments
 (0)