Skip to content

Commit dce777b

Browse files
author
jnecus
committed
Revert "Merge remote-tracking branch 'upstream/master'"
This reverts commit 0d68e31, reversing changes made to 14e2c79.
1 parent 0d68e31 commit dce777b

Some content is hidden

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

77 files changed

+2609
-2954
lines changed

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ matrix:
7575

7676
before_install:
7777
- echo "before_install"
78-
# Use blocking IO on travis. Ref: https://github.com/travis-ci/travis-ci/issues/8920#issuecomment-352661024
78+
# set non-blocking IO on travis
79+
# https://github.com/travis-ci/travis-ci/issues/8920#issuecomment-352661024
7980
- python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
8081
- source ci/travis_process_gbq_encryption.sh
8182
- export PATH="$HOME/miniconda3/bin:$PATH"

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
[![Downloads](https://anaconda.org/conda-forge/pandas/badges/downloads.svg)](https://pandas.pydata.org)
1717
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pydata/pandas)
1818
[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org)
19-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
2019

2120
## What is it?
2221

doc/source/ecosystem.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ substantial projects that you feel should be on this list, please let us know.
3030
Data cleaning and validation
3131
----------------------------
3232

33-
`Pyjanitor <https://github.com/ericmjl/pyjanitor/>`__
33+
`pyjanitor <https://github.com/ericmjl/pyjanitor/>`__
3434
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3535

3636
Pyjanitor provides a clean API for cleaning data, using method chaining.
@@ -115,7 +115,7 @@ It is very similar to the matplotlib plotting backend, but provides interactive
115115
web-based charts and maps.
116116

117117

118-
`Seaborn <https://seaborn.pydata.org>`__
118+
`seaborn <https://seaborn.pydata.org>`__
119119
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120120

121121
Seaborn is a Python visualization library based on
@@ -136,7 +136,7 @@ provides a powerful, declarative and extremely general way to generate bespoke p
136136
Various implementations to other languages are available.
137137
A good implementation for Python users is `has2k1/plotnine <https://github.com/has2k1/plotnine/>`__.
138138

139-
`IPython vega <https://github.com/vega/ipyvega>`__
139+
`IPython Vega <https://github.com/vega/ipyvega>`__
140140
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
141141

142142
`IPython Vega <https://github.com/vega/ipyvega>`__ leverages `Vega
@@ -147,7 +147,7 @@ A good implementation for Python users is `has2k1/plotnine <https://github.com/h
147147

148148
`Plotly’s <https://plot.ly/>`__ `Python API <https://plot.ly/python/>`__ enables interactive figures and web shareability. Maps, 2D, 3D, and live-streaming graphs are rendered with WebGL and `D3.js <https://d3js.org/>`__. The library supports plotting directly from a pandas DataFrame and cloud-based collaboration. Users of `matplotlib, ggplot for Python, and Seaborn <https://plot.ly/python/matplotlib-to-plotly-tutorial/>`__ can convert figures into interactive web-based plots. Plots can be drawn in `IPython Notebooks <https://plot.ly/ipython-notebooks/>`__ , edited with R or MATLAB, modified in a GUI, or embedded in apps and dashboards. Plotly is free for unlimited sharing, and has `cloud <https://plot.ly/product/plans/>`__, `offline <https://plot.ly/python/offline/>`__, or `on-premise <https://plot.ly/product/enterprise/>`__ accounts for private use.
149149

150-
`Qtpandas <https://github.com/draperjames/qtpandas>`__
150+
`QtPandas <https://github.com/draperjames/qtpandas>`__
151151
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
152152

153153
Spun off from the main pandas library, the `qtpandas <https://github.com/draperjames/qtpandas>`__
@@ -187,7 +187,7 @@ See :ref:`Options and Settings <options>` and
187187
:ref:`Available Options <options.available>`
188188
for pandas ``display.`` settings.
189189

190-
`Quantopian/qgrid <https://github.com/quantopian/qgrid>`__
190+
`quantopian/qgrid <https://github.com/quantopian/qgrid>`__
191191
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192192

193193
qgrid is "an interactive grid for sorting and filtering
@@ -249,12 +249,12 @@ The following data feeds are available:
249249
* Stooq Index Data
250250
* MOEX Data
251251

252-
`Quandl/Python <https://github.com/quandl/Python>`__
252+
`quandl/Python <https://github.com/quandl/Python>`__
253253
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
254254
Quandl API for Python wraps the Quandl REST API to return
255255
Pandas DataFrames with timeseries indexes.
256256

257-
`Pydatastream <https://github.com/vfilimonov/pydatastream>`__
257+
`pydatastream <https://github.com/vfilimonov/pydatastream>`__
258258
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
259259
PyDatastream is a Python interface to the
260260
`Refinitiv Datastream (DWS) <https://www.refinitiv.com/en/products/datastream-macroeconomic-analysis>`__
@@ -384,7 +384,7 @@ Pandas provides an interface for defining
384384
system. The following libraries implement that interface to provide types not
385385
found in NumPy or pandas, which work well with pandas' data containers.
386386

387-
`Cyberpandas`_
387+
`cyberpandas`_
388388
~~~~~~~~~~~~~~
389389

390390
Cyberpandas provides an extension type for storing arrays of IP Addresses. These
@@ -411,4 +411,4 @@ Library Accessor Classes Description
411411
.. _pdvega: https://altair-viz.github.io/pdvega/
412412
.. _Altair: https://altair-viz.github.io/
413413
.. _pandas_path: https://github.com/drivendataorg/pandas-path/
414-
.. _pathlib.Path: https://docs.python.org/3/library/pathlib.html
414+
.. _pathlib.Path: https://docs.python.org/3/library/pathlib.html

doc/source/reference/offset_frequency.rst

-8
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,6 @@ Properties
10441044
Tick.nanos
10451045
Tick.normalize
10461046
Tick.rule_code
1047-
Tick.n
10481047

10491048
Methods
10501049
~~~~~~~
@@ -1078,7 +1077,6 @@ Properties
10781077
Day.nanos
10791078
Day.normalize
10801079
Day.rule_code
1081-
Day.n
10821080

10831081
Methods
10841082
~~~~~~~
@@ -1112,7 +1110,6 @@ Properties
11121110
Hour.nanos
11131111
Hour.normalize
11141112
Hour.rule_code
1115-
Hour.n
11161113

11171114
Methods
11181115
~~~~~~~
@@ -1146,7 +1143,6 @@ Properties
11461143
Minute.nanos
11471144
Minute.normalize
11481145
Minute.rule_code
1149-
Minute.n
11501146

11511147
Methods
11521148
~~~~~~~
@@ -1180,7 +1176,6 @@ Properties
11801176
Second.nanos
11811177
Second.normalize
11821178
Second.rule_code
1183-
Second.n
11841179

11851180
Methods
11861181
~~~~~~~
@@ -1214,7 +1209,6 @@ Properties
12141209
Milli.nanos
12151210
Milli.normalize
12161211
Milli.rule_code
1217-
Milli.n
12181212

12191213
Methods
12201214
~~~~~~~
@@ -1248,7 +1242,6 @@ Properties
12481242
Micro.nanos
12491243
Micro.normalize
12501244
Micro.rule_code
1251-
Micro.n
12521245

12531246
Methods
12541247
~~~~~~~
@@ -1282,7 +1275,6 @@ Properties
12821275
Nano.nanos
12831276
Nano.normalize
12841277
Nano.rule_code
1285-
Nano.n
12861278

12871279
Methods
12881280
~~~~~~~

doc/source/user_guide/computation.rst

-18
Original file line numberDiff line numberDiff line change
@@ -648,24 +648,6 @@ from present information back to past information. This allows the rolling windo
648648
Currently, this feature is only implemented for time-based windows.
649649
For fixed windows, the closed parameter cannot be set and the rolling window will always have both endpoints closed.
650650

651-
.. _stats.iter_rolling_window:
652-
653-
Iteration over window:
654-
~~~~~~~~~~~~~~~~~~~~~~
655-
656-
.. versionadded:: 1.1.0
657-
658-
``Rolling`` and ``Expanding`` objects now support iteration. Be noted that ``min_periods`` is ignored in iteration.
659-
660-
.. ipython::
661-
662-
In [1]: df = pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
663-
664-
In [2]: for i in df.rolling(2):
665-
...: print(i)
666-
...:
667-
668-
669651
.. _stats.moments.ts-versus-resampling:
670652

671653
Time-aware rolling vs. resampling

doc/source/whatsnew/v1.1.0.rst

-6
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ Other enhancements
235235
:class:`~pandas.io.stata.StataWriter`, :class:`~pandas.io.stata.StataWriter117`,
236236
and :class:`~pandas.io.stata.StataWriterUTF8` (:issue:`26599`).
237237
- :meth:`HDFStore.put` now accepts `track_times` parameter. Parameter is passed to ``create_table`` method of ``PyTables`` (:issue:`32682`).
238-
- Make :class:`pandas.core.window.Rolling` and :class:`pandas.core.window.Expanding` iterable(:issue:`11704`)
239238

240239
.. ---------------------------------------------------------------------------
241240
@@ -586,7 +585,6 @@ Deprecations
586585

587586
- :func:`pandas.api.types.is_categorical` is deprecated and will be removed in a future version; use `:func:pandas.api.types.is_categorical_dtype` instead (:issue:`33385`)
588587
- :meth:`Index.get_value` is deprecated and will be removed in a future version (:issue:`19728`)
589-
- :meth:`DateOffset.__call__` is deprecated and will be removed in a future version, use ``offset + other`` instead (:issue:`34171`)
590588

591589
.. ---------------------------------------------------------------------------
592590
@@ -607,8 +605,6 @@ Performance improvements
607605
sparse values from ``scipy.sparse`` matrices using the
608606
:meth:`DataFrame.sparse.from_spmatrix` constructor (:issue:`32821`,
609607
:issue:`32825`, :issue:`32826`, :issue:`32856`, :issue:`32858`).
610-
- Performance improvement for groupby methods :meth:`~pandas.core.groupby.groupby.Groupby.first`
611-
and :meth:`~pandas.core.groupby.groupby.Groupby.last` (:issue:`34178`)
612608
- Performance improvement in :func:`factorize` for nullable (integer and boolean) dtypes (:issue:`33064`).
613609
- Performance improvement in reductions (sum, prod, min, max) for nullable (integer and boolean) dtypes (:issue:`30982`, :issue:`33261`, :issue:`33442`).
614610

@@ -817,8 +813,6 @@ Groupby/resample/rolling
817813
- Bug in :meth:`GroupBy.first` and :meth:`GroupBy.last` where None is not preserved in object dtype (:issue:`32800`)
818814
- Bug in :meth:`Rolling.min` and :meth:`Rolling.max`: Growing memory usage after multiple calls when using a fixed window (:issue:`30726`)
819815
- Bug in :meth:`GroupBy.agg`, :meth:`GroupBy.transform`, and :meth:`GroupBy.resample` where subclasses are not preserved (:issue:`28330`)
820-
- Bug in :meth:`GroupBy.rolling.apply` ignores args and kwargs parameters (:issue:`33433`)
821-
822816

823817
Reshaping
824818
^^^^^^^^^

pandas/_libs/groupby.pyx

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ cimport numpy as cnp
99
from numpy cimport (ndarray,
1010
int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t,
1111
uint32_t, uint64_t, float32_t, float64_t, complex64_t, complex128_t)
12-
from numpy.math cimport NAN
1312
cnp.import_array()
1413

14+
cdef extern from "numpy/npy_math.h":
15+
float64_t NAN "NPY_NAN"
16+
1517
from pandas._libs.util cimport numeric, get_nat
1618

1719
from pandas._libs.algos cimport (swap, TiebreakEnumType, TIEBREAK_AVERAGE,

pandas/_libs/hashtable.pyx

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ from libc.stdlib cimport malloc, free
88
import numpy as np
99
cimport numpy as cnp
1010
from numpy cimport ndarray, uint8_t, uint32_t, float64_t
11-
from numpy.math cimport NAN
1211
cnp.import_array()
1312

13+
cdef extern from "numpy/npy_math.h":
14+
float64_t NAN "NPY_NAN"
1415

1516
from pandas._libs.khash cimport (
1617
khiter_t,
@@ -53,7 +54,7 @@ from pandas._libs.khash cimport (
5354
)
5455

5556

56-
from pandas._libs cimport util
57+
cimport pandas._libs.util as util
5758

5859
from pandas._libs.missing cimport checknull
5960

pandas/_libs/index.pyx

+5-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ from numpy cimport (
1919
cnp.import_array()
2020

2121

22-
from pandas._libs cimport util
22+
cimport pandas._libs.util as util
2323

24+
from pandas._libs.tslibs import Period, Timedelta
2425
from pandas._libs.tslibs.nattype cimport c_NaT as NaT
25-
from pandas._libs.tslibs.base cimport ABCTimestamp, ABCTimedelta, ABCPeriod
26+
from pandas._libs.tslibs.base cimport ABCTimestamp
2627

2728
from pandas._libs.hashtable cimport HashTable
2829

@@ -469,7 +470,7 @@ cdef class TimedeltaEngine(DatetimeEngine):
469470
return 'm8[ns]'
470471

471472
cdef int64_t _unbox_scalar(self, scalar) except? -1:
472-
if not (isinstance(scalar, ABCTimedelta) or scalar is NaT):
473+
if not (isinstance(scalar, Timedelta) or scalar is NaT):
473474
raise TypeError(scalar)
474475
return scalar.value
475476

@@ -479,7 +480,7 @@ cdef class PeriodEngine(Int64Engine):
479480
cdef int64_t _unbox_scalar(self, scalar) except? -1:
480481
if scalar is NaT:
481482
return scalar.value
482-
if isinstance(scalar, ABCPeriod):
483+
if isinstance(scalar, Period):
483484
# NB: we assume that we have the correct freq here.
484485
return scalar.ordinal
485486
raise TypeError(scalar)

pandas/_libs/internals.pyx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from collections import defaultdict
2-
31
import cython
2+
from collections import defaultdict
43
from cython import Py_ssize_t
54

65
from cpython.slice cimport PySlice_GetIndicesEx

pandas/_libs/interval.pyx

+6-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ from numpy cimport (
3333
cnp.import_array()
3434

3535

36-
from pandas._libs cimport util
36+
cimport pandas._libs.util as util
3737

3838
from pandas._libs.hashtable cimport Int64Vector
3939
from pandas._libs.tslibs.util cimport (
@@ -42,7 +42,8 @@ from pandas._libs.tslibs.util cimport (
4242
is_timedelta64_object,
4343
)
4444

45-
from pandas._libs.tslibs.base cimport ABCTimestamp, ABCTimedelta
45+
from pandas._libs.tslibs import Timestamp
46+
from pandas._libs.tslibs.timedeltas import Timedelta
4647
from pandas._libs.tslibs.timezones cimport tz_compare
4748

4849

@@ -328,7 +329,7 @@ cdef class Interval(IntervalMixin):
328329
raise ValueError(f"invalid option for 'closed': {closed}")
329330
if not left <= right:
330331
raise ValueError("left side of interval must be <= right side")
331-
if (isinstance(left, ABCTimestamp) and
332+
if (isinstance(left, Timestamp) and
332333
not tz_compare(left.tzinfo, right.tzinfo)):
333334
# GH 18538
334335
raise ValueError("left and right must have the same time zone, got "
@@ -340,7 +341,7 @@ cdef class Interval(IntervalMixin):
340341
def _validate_endpoint(self, endpoint):
341342
# GH 23013
342343
if not (is_integer_object(endpoint) or is_float_object(endpoint) or
343-
isinstance(endpoint, (ABCTimestamp, ABCTimedelta))):
344+
isinstance(endpoint, (Timestamp, Timedelta))):
344345
raise ValueError("Only numeric, Timestamp and Timedelta endpoints "
345346
"are allowed when constructing an Interval.")
346347

@@ -370,7 +371,7 @@ cdef class Interval(IntervalMixin):
370371
right = self.right
371372

372373
# TODO: need more general formatting methodology here
373-
if isinstance(left, ABCTimestamp) and isinstance(right, ABCTimestamp):
374+
if isinstance(left, Timestamp) and isinstance(right, Timestamp):
374375
left = left._short_repr
375376
right = right._short_repr
376377

pandas/_libs/lib.pyx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from collections import abc
22
from decimal import Decimal
3+
34
import warnings
45

56
import cython
@@ -62,7 +63,7 @@ cdef extern from "numpy/arrayobject.h":
6263
cdef extern from "src/parse_helper.h":
6364
int floatify(object, float64_t *result, int *maybe_int) except -1
6465

65-
from pandas._libs cimport util
66+
cimport pandas._libs.util as util
6667
from pandas._libs.util cimport is_nan, UINT64_MAX, INT64_MAX, INT64_MIN
6768

6869
from pandas._libs.tslib import array_to_datetime

pandas/_libs/missing.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ cimport numpy as cnp
88
from numpy cimport ndarray, int64_t, uint8_t, float64_t
99
cnp.import_array()
1010

11-
from pandas._libs cimport util
11+
cimport pandas._libs.util as util
1212

1313

1414
from pandas._libs.tslibs.np_datetime cimport get_datetime64_value, get_timedelta64_value

pandas/_libs/parsers.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ cimport numpy as cnp
3434
from numpy cimport ndarray, uint8_t, uint64_t, int64_t, float64_t
3535
cnp.import_array()
3636

37-
from pandas._libs cimport util
37+
cimport pandas._libs.util as util
3838
from pandas._libs.util cimport UINT64_MAX, INT64_MAX, INT64_MIN
3939
import pandas._libs.lib as lib
4040

pandas/_libs/reduction.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ from numpy cimport (ndarray,
1414
flatiter)
1515
cnp.import_array()
1616

17-
from pandas._libs cimport util
17+
cimport pandas._libs.util as util
1818
from pandas._libs.lib import maybe_convert_objects, is_scalar
1919

2020

@@ -603,7 +603,7 @@ cdef class BlockSlider:
603603
arr.shape[1] = 0
604604

605605

606-
def compute_reduction(arr: ndarray, f, axis: int = 0, dummy=None, labels=None):
606+
def compute_reduction(arr: np.ndarray, f, axis: int = 0, dummy=None, labels=None):
607607
"""
608608
609609
Parameters

0 commit comments

Comments
 (0)