Skip to content

Commit 5944b8b

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature/fix_wom
2 parents 8aca9f1 + 7ed1f53 commit 5944b8b

File tree

129 files changed

+2527
-1381
lines changed

Some content is hidden

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

129 files changed

+2527
-1381
lines changed

.github/PULL_REQUEST_TEMPLATE.md

-24
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
1-
Checklist for the pandas documentation sprint (ignore this if you are doing
2-
an unrelated PR):
3-
4-
- [ ] PR title is "DOC: update the <your-function-or-method> docstring"
5-
- [ ] The validation script passes: `scripts/validate_docstrings.py <your-function-or-method>`
6-
- [ ] The PEP8 style check passes: `git diff upstream/master -u -- "*.py" | flake8 --diff`
7-
- [ ] The html version looks good: `python doc/make.py --single <your-function-or-method>`
8-
- [ ] It has been proofread on language by another sprint participant
9-
10-
Please include the output of the validation script below between the "```" ticks:
11-
12-
```
13-
# paste output of "scripts/validate_docstrings.py <your-function-or-method>" here
14-
# between the "```" (remove this comment, but keep the "```")
15-
16-
```
17-
18-
If the validation script still gives errors, but you think there is a good reason
19-
to deviate in this case (and there are certainly such cases), please state this
20-
explicitly.
21-
22-
23-
Checklist for other PRs (remove this part if you are doing a PR for the pandas documentation sprint):
24-
251
- [ ] closes #xxxx
262
- [ ] tests added / passed
273
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ matrix:
5656
# In allow_failures
5757
- dist: trusty
5858
env:
59-
- JOB="2.7_SLOW" SLOW=true
59+
- JOB="3.6_SLOW" SLOW=true
6060
# In allow_failures
6161
- dist: trusty
6262
env:
@@ -72,7 +72,7 @@ matrix:
7272
allow_failures:
7373
- dist: trusty
7474
env:
75-
- JOB="2.7_SLOW" SLOW=true
75+
- JOB="3.6_SLOW" SLOW=true
7676
- dist: trusty
7777
env:
7878
- JOB="3.6_NUMPY_DEV" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate"

asv_bench/benchmarks/frame_ctor.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ class FromDicts(object):
1616

1717
def setup(self):
1818
N, K = 5000, 50
19-
index = tm.makeStringIndex(N)
20-
columns = tm.makeStringIndex(K)
21-
frame = DataFrame(np.random.randn(N, K), index=index, columns=columns)
19+
self.index = tm.makeStringIndex(N)
20+
self.columns = tm.makeStringIndex(K)
21+
frame = DataFrame(np.random.randn(N, K), index=self.index,
22+
columns=self.columns)
2223
self.data = frame.to_dict()
23-
self.some_dict = list(self.data.values())[0]
2424
self.dict_list = frame.to_dict(orient='records')
2525
self.data2 = {i: {j: float(j) for j in range(100)}
2626
for i in range(2000)}
@@ -31,8 +31,14 @@ def time_list_of_dict(self):
3131
def time_nested_dict(self):
3232
DataFrame(self.data)
3333

34-
def time_dict(self):
35-
Series(self.some_dict)
34+
def time_nested_dict_index(self):
35+
DataFrame(self.data, index=self.index)
36+
37+
def time_nested_dict_columns(self):
38+
DataFrame(self.data, columns=self.columns)
39+
40+
def time_nested_dict_index_columns(self):
41+
DataFrame(self.data, index=self.index, columns=self.columns)
3642

3743
def time_nested_dict_int64(self):
3844
# nested dict, integer indexes, regression described in #621

ci/environment-dev.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ dependencies:
1111
- python-dateutil>=2.5.0
1212
- python=3
1313
- pytz
14-
- setuptools>=3.3
14+
- setuptools>=24.2.0
1515
- sphinx

ci/lint.sh

+8
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ if [ "$LINT" ]; then
165165
RET=1
166166
fi
167167
echo "Check for deprecated messages without sphinx directive DONE"
168+
169+
echo "Check for old-style classes"
170+
grep -R --include="*.py" -E "class\s\S*[^)]:" pandas scripts
171+
172+
if [ $? = "0" ]; then
173+
RET=1
174+
fi
175+
echo "Check for old-style classes DONE"
168176

169177
else
170178
echo "NOT Linting"

ci/requirements-3.6_DOC.run

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sphinx
55
nbconvert
66
nbformat
77
notebook
8-
matplotlib=2.1*
8+
matplotlib
99
seaborn
1010
scipy
1111
lxml
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
python=2.7*
1+
python=3.6*
22
python-dateutil
33
pytz
4-
numpy=1.10*
4+
numpy
55
cython
File renamed without changes.

ci/requirements-2.7_SLOW.run renamed to ci/requirements-3.6_SLOW.run

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
python-dateutil
22
pytz
3-
numpy=1.10*
4-
matplotlib=1.4.3
3+
numpy
4+
matplotlib
55
scipy
66
patsy
77
xlwt

ci/requirements_dev.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ moto
77
pytest>=3.1
88
python-dateutil>=2.5.0
99
pytz
10-
setuptools>=3.3
11-
sphinx
10+
setuptools>=24.2.0
11+
sphinx

doc/source/api.rst

+3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ HDFStore: PyTables (HDF5)
9999
HDFStore.get
100100
HDFStore.select
101101
HDFStore.info
102+
HDFStore.keys
102103

103104
Feather
104105
~~~~~~~
@@ -1687,6 +1688,7 @@ MultiIndex Components
16871688
MultiIndex.swaplevel
16881689
MultiIndex.reorder_levels
16891690
MultiIndex.remove_unused_levels
1691+
MultiIndex.unique
16901692

16911693
MultiIndex Selecting
16921694
~~~~~~~~~~~~~~~~~~~~
@@ -2206,6 +2208,7 @@ Computations / Descriptive Stats
22062208
GroupBy.ohlc
22072209
GroupBy.prod
22082210
GroupBy.rank
2211+
GroupBy.pct_change
22092212
GroupBy.size
22102213
GroupBy.sem
22112214
GroupBy.std

doc/source/conf.py

+24
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import re
1717
import inspect
1818
import importlib
19+
from sphinx.ext.autosummary import _import_by_name
1920
import warnings
2021

2122

@@ -47,6 +48,10 @@
4748

4849
])
4950

51+
# numpydoc is available in the sphinxext directory, and can't be imported
52+
# until sphinxext is available in the Python path
53+
from numpydoc.docscrape import NumpyDocString
54+
5055
# -- General configuration -----------------------------------------------
5156

5257
# Add any Sphinx extension module names here, as strings. They can be
@@ -350,6 +355,7 @@
350355
intersphinx_mapping = {
351356
'statsmodels': ('http://www.statsmodels.org/devel/', None),
352357
'matplotlib': ('http://matplotlib.org/', None),
358+
'pandas-gbq': ('https://pandas-gbq.readthedocs.io/en/latest/', None),
353359
'python': ('https://docs.python.org/3/', None),
354360
'numpy': ('https://docs.scipy.org/doc/numpy/', None),
355361
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
@@ -505,9 +511,27 @@ def _replace_pandas_items(self, display_name, sig, summary, real_name):
505511
summary = 'Series plotting accessor and method'
506512
return (display_name, sig, summary, real_name)
507513

514+
@staticmethod
515+
def _is_deprecated(real_name):
516+
try:
517+
obj, parent, modname = _import_by_name(real_name)
518+
except ImportError:
519+
return False
520+
doc = NumpyDocString(obj.__doc__ or '')
521+
summary = ''.join(doc['Summary'] + doc['Extended Summary'])
522+
return '.. deprecated::' in summary
523+
524+
def _add_deprecation_prefixes(self, items):
525+
for item in items:
526+
display_name, sig, summary, real_name = item
527+
if self._is_deprecated(real_name):
528+
summary = '(DEPRECATED) %s' % summary
529+
yield display_name, sig, summary, real_name
530+
508531
def get_items(self, names):
509532
items = Autosummary.get_items(self, names)
510533
items = [self._replace_pandas_items(*item) for item in items]
534+
items = list(self._add_deprecation_prefixes(items))
511535
return items
512536

513537

doc/source/install.rst

+28-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,31 @@ Instructions for installing from source,
1515
`PyPI <http://pypi.python.org/pypi/pandas>`__, `ActivePython <https://www.activestate.com/activepython/downloads>`__, various Linux distributions, or a
1616
`development version <http://github.com/pandas-dev/pandas>`__ are also provided.
1717

18+
.. _install.dropping_27:
19+
20+
Plan for dropping Python 2.7
21+
----------------------------
22+
23+
The Python core team plans to stop supporting Python 2.7 on January 1st, 2020.
24+
In line with `NumPy's plans`_, all pandas releases through December 31, 2018
25+
will support Python 2.
26+
27+
The final release before **December 31, 2018** will be the last release to
28+
support Python 2. The released package will continue to be available on
29+
PyPI and through conda.
30+
31+
Starting **January 1, 2019**, all releases will be Python 3 only.
32+
33+
If there are people interested in continued support for Python 2.7 past December
34+
31, 2018 (either backporting bugfixes or funding) please reach out to the
35+
maintainers on the issue tracker.
36+
37+
For more information, see the `Python 3 statement`_ and the `Porting to Python 3 guide`_.
38+
39+
.. _NumPy's plans: https://github.com/numpy/numpy/blob/master/doc/neps/nep-0014-dropping-python2.7-proposal.rst#plan-for-dropping-python-27-support
40+
.. _Python 3 statement: http://python3statement.org/
41+
.. _Porting to Python 3 guide: https://docs.python.org/3/howto/pyporting.html
42+
1843
Python version support
1944
----------------------
2045

@@ -137,8 +162,8 @@ pandas can be installed via pip from
137162
Installing with ActivePython
138163
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
139164

140-
Installation instructions for
141-
`ActivePython <https://www.activestate.com/activepython>`__ can be found
165+
Installation instructions for
166+
`ActivePython <https://www.activestate.com/activepython>`__ can be found
142167
`here <https://www.activestate.com/activepython/downloads>`__. Versions
143168
2.7 and 3.5 include pandas.
144169

@@ -198,7 +223,7 @@ installed), make sure you have `pytest
198223
Dependencies
199224
------------
200225

201-
* `setuptools <https://setuptools.readthedocs.io/en/latest/>`__: 3.3.0 or higher
226+
* `setuptools <https://setuptools.readthedocs.io/en/latest/>`__: 24.2.0 or higher
202227
* `NumPy <http://www.numpy.org>`__: 1.9.0 or higher
203228
* `python-dateutil <//https://dateutil.readthedocs.io/en/stable/>`__: 2.5.0 or higher
204229
* `pytz <http://pytz.sourceforge.net/>`__

0 commit comments

Comments
 (0)