Skip to content

Commit 91b8d28

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents f51dbdf + 098831d commit 91b8d28

File tree

117 files changed

+3603
-1669
lines changed

Some content is hidden

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

117 files changed

+3603
-1669
lines changed

.travis.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,10 @@ matrix:
8080
apt:
8181
packages:
8282
- xsel
83-
- python: 3.6-dev
83+
- python: 3.6
8484
env:
8585
- PYTHON_VERSION=3.6
86-
- JOB_NAME: "36_dev"
87-
- JOB_TAG=_DEV
86+
- JOB_NAME: "36"
8887
- NOSE_ARGS="not slow and not network and not disabled"
8988
- PANDAS_TESTING_MODE="deprecate"
9089
addons:
@@ -183,9 +182,9 @@ matrix:
183182
- CACHE_NAME="35_ascii"
184183
- USE_CACHE=true
185184
# In allow_failures
186-
- python: 2.7
185+
- python: 3.5
187186
env:
188-
- PYTHON_VERSION=2.7
187+
- PYTHON_VERSION=3.5
189188
- JOB_NAME: "doc_build"
190189
- FULL_DEPS=true
191190
- DOC_BUILD=true
@@ -276,9 +275,9 @@ matrix:
276275
- LOCALE_OVERRIDE="C"
277276
- CACHE_NAME="35_ascii"
278277
- USE_CACHE=true
279-
- python: 2.7
278+
- python: 3.5
280279
env:
281-
- PYTHON_VERSION=2.7
280+
- PYTHON_VERSION=3.5
282281
- JOB_NAME: "doc_build"
283282
- FULL_DEPS=true
284283
- DOC_BUILD=true

appveyor.yml

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ install:
8080
- cmd: conda config --set ssl_verify false
8181

8282
# add the pandas channel *before* defaults to have defaults take priority
83+
- cmd: conda config --add channels conda-forge
8384
- cmd: conda config --add channels pandas
8485
- cmd: conda config --remove channels defaults
8586
- cmd: conda config --add channels defaults

asv_bench/benchmarks/inference.py

+20-1
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,23 @@ def setup(self, dtype, downcast):
9595
self.data = self.data_dict[dtype]
9696

9797
def time_downcast(self, dtype, downcast):
98-
pd.to_numeric(self.data, downcast=downcast)
98+
pd.to_numeric(self.data, downcast=downcast)
99+
100+
101+
class MaybeConvertNumeric(object):
102+
103+
def setup(self):
104+
n = 1000000
105+
arr = np.repeat([2**63], n)
106+
arr = arr + np.arange(n).astype('uint64')
107+
arr = np.array([arr[i] if i%2 == 0 else
108+
str(arr[i]) for i in range(n)],
109+
dtype=object)
110+
111+
arr[-1] = -1
112+
self.data = arr
113+
self.na_values = set()
114+
115+
def time_convert(self):
116+
pd.lib.maybe_convert_numeric(self.data, self.na_values,
117+
coerce_numeric=False)

asv_bench/benchmarks/io_bench.py

+23
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,29 @@ def time_read_parse_dates_iso8601(self):
128128
read_csv(StringIO(self.data), header=None, names=['foo'], parse_dates=['foo'])
129129

130130

131+
class read_uint64_integers(object):
132+
goal_time = 0.2
133+
134+
def setup(self):
135+
self.na_values = [2**63 + 500]
136+
137+
self.arr1 = np.arange(10000).astype('uint64') + 2**63
138+
self.data1 = '\n'.join(map(lambda x: str(x), self.arr1))
139+
140+
self.arr2 = self.arr1.copy().astype(object)
141+
self.arr2[500] = -1
142+
self.data2 = '\n'.join(map(lambda x: str(x), self.arr2))
143+
144+
def time_read_uint64(self):
145+
read_csv(StringIO(self.data1), header=None)
146+
147+
def time_read_uint64_neg_values(self):
148+
read_csv(StringIO(self.data2), header=None)
149+
150+
def time_read_uint64_na_values(self):
151+
read_csv(StringIO(self.data1), header=None, na_values=self.na_values)
152+
153+
131154
class write_csv_standard(object):
132155
goal_time = 0.2
133156

ci/install-3.6_DEV.sh

-16
This file was deleted.

ci/install_travis.sh

+11-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ else
7171
conda config --set always_yes true --set changeps1 false || exit 1
7272
conda update -q conda
7373

74-
# add the pandas channel *before* defaults to have defaults take priority
74+
# add the pandas channel to take priority
75+
# to add extra packages
7576
echo "add channels"
7677
conda config --add channels pandas || exit 1
7778
conda config --remove channels defaults || exit 1
@@ -90,7 +91,15 @@ if [ -e ${INSTALL} ]; then
9091
else
9192

9293
# create new env
93-
time conda create -n pandas python=$PYTHON_VERSION nose coverage flake8 || exit 1
94+
time conda create -n pandas python=$PYTHON_VERSION nose || exit 1
95+
96+
if [ "$COVERAGE" ]; then
97+
pip install coverage
98+
fi
99+
if [ "$LINT" ]; then
100+
conda install flake8
101+
pip install cpplint
102+
fi
94103
fi
95104

96105
# build deps

ci/lint.sh

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ source activate pandas
77
RET=0
88

99
if [ "$LINT" ]; then
10-
pip install cpplint
1110

1211
# pandas/rpy is deprecated and will be removed.
1312
# pandas/src is C code, so no need to search there.

ci/requirements-2.7-64.run

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pytz
33
numpy=1.10*
44
xlwt
55
numexpr
6-
pytables
6+
pytables==3.2.2
77
matplotlib
88
openpyxl
99
xlrd

ci/requirements-2.7.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
source activate pandas
4+
5+
echo "install 27"
6+
7+
conda install -n pandas -c conda-forge feather-format

ci/requirements-3.5-64.run

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
python-dateutil
22
pytz
3-
numpy=1.10*
3+
numpy
44
openpyxl
55
xlsxwriter
66
xlrd
77
xlwt
88
scipy
9+
feather-format
910
numexpr
1011
pytables
1112
matplotlib

ci/requirements-3.5.run

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,4 @@ pymysql
1818
psycopg2
1919
xarray
2020
s3fs
21-
22-
# incompat with conda ATM
23-
# beautiful-soup
21+
beautifulsoup4

ci/requirements-3.5.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
source activate pandas
4+
5+
echo "install 35"
6+
7+
conda install -n pandas -c conda-forge feather-format
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dateutil
1+
python-dateutil
22
pytz
33
numpy
44
cython

ci/requirements-2.7_DOC_BUILD.run renamed to ci/requirements-3.5_DOC_BUILD.run

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ notebook
77
matplotlib
88
scipy
99
lxml
10-
beautiful-soup
10+
beautifulsoup4
1111
html5lib
1212
pytables
1313
openpyxl=1.8.5

ci/requirements-3.5_DOC_BUILD.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
source activate pandas
4+
5+
echo "install DOC_BUILD"
6+
7+
conda install -n pandas -c conda-forge feather-format

ci/requirements-3.5_OSX.run

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@ jinja2
1313
bottleneck
1414
xarray
1515
s3fs
16-
17-
# incompat with conda ATM
18-
# beautiful-soup
16+
beautifulsoup4

ci/requirements-3.5_OSX.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
source activate pandas
4+
5+
echo "install 35_OSX"
6+
7+
conda install -n pandas -c conda-forge feather-format

ci/requirements-3.6.build

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
python-dateutil
2+
pytz
3+
numpy
4+
cython

ci/requirements-3.6.run

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
python-dateutil
2+
pytz
3+
numpy
4+
scipy

doc/_templates/autosummary/accessor.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
.. currentmodule:: {{ module.split('.')[0] }}
55

6-
.. automethod:: {{ [module.split('.')[1], objname]|join('.') }}
6+
.. autoaccessor:: {{ (module.split('.')[1:] + [objname]) | join('.') }}

doc/_templates/autosummary/accessor_attribute.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
.. currentmodule:: {{ module.split('.')[0] }}
55

6-
.. autoaccessorattribute:: {{ [module.split('.')[1], objname]|join('.') }}
6+
.. autoaccessorattribute:: {{ (module.split('.')[1:] + [objname]) | join('.') }}

doc/_templates/autosummary/accessor_callable.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
.. currentmodule:: {{ module.split('.')[0] }}
55

6-
.. autoaccessorcallable:: {{ [module.split('.')[1], objname]|join('.') }}.__call__
6+
.. autoaccessorcallable:: {{ (module.split('.')[1:] + [objname]) | join('.') }}.__call__

doc/_templates/autosummary/accessor_method.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
.. currentmodule:: {{ module.split('.')[0] }}
55

6-
.. autoaccessormethod:: {{ [module.split('.')[1], objname]|join('.') }}
6+
.. autoaccessormethod:: {{ (module.split('.')[1:] + [objname]) | join('.') }}

doc/cheatsheet/Pandas_Cheat_Sheet.pdf

-30 Bytes
Binary file not shown.
1.08 KB
Binary file not shown.

doc/source/api.rst

+9
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ HDFStore: PyTables (HDF5)
8383
HDFStore.get
8484
HDFStore.select
8585

86+
Feather
87+
~~~~~~~
88+
89+
.. autosummary::
90+
:toctree: generated/
91+
92+
read_feather
93+
8694
SAS
8795
~~~
8896

@@ -1015,6 +1023,7 @@ Serialization / IO / Conversion
10151023
DataFrame.to_excel
10161024
DataFrame.to_json
10171025
DataFrame.to_html
1026+
DataFrame.to_feather
10181027
DataFrame.to_latex
10191028
DataFrame.to_stata
10201029
DataFrame.to_msgpack

doc/source/categorical.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ To get back to the original Series or `numpy` array, use ``Series.astype(origina
129129
s
130130
s2 = s.astype('category')
131131
s2
132-
s3 = s2.astype('string')
133-
s3
132+
s2.astype(str)
134133
np.asarray(s2)
135134
136135
If you have already `codes` and `categories`, you can use the :func:`~pandas.Categorical.from_codes`

doc/source/conf.py

+23
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,23 @@
326326
from sphinx.ext.autosummary import Autosummary
327327

328328

329+
class AccessorDocumenter(MethodDocumenter):
330+
"""
331+
Specialized Documenter subclass for accessors.
332+
"""
333+
334+
objtype = 'accessor'
335+
directivetype = 'method'
336+
337+
# lower than MethodDocumenter so this is not chosen for normal methods
338+
priority = 0.6
339+
340+
def format_signature(self):
341+
# this method gives an error/warning for the accessors, therefore
342+
# overriding it (accessor has no arguments)
343+
return ''
344+
345+
329346
class AccessorLevelDocumenter(Documenter):
330347
"""
331348
Specialized Documenter subclass for objects on accessor level (methods,
@@ -381,12 +398,17 @@ class AccessorAttributeDocumenter(AccessorLevelDocumenter, AttributeDocumenter):
381398
objtype = 'accessorattribute'
382399
directivetype = 'attribute'
383400

401+
# lower than AttributeDocumenter so this is not chosen for normal attributes
402+
priority = 0.6
384403

385404
class AccessorMethodDocumenter(AccessorLevelDocumenter, MethodDocumenter):
386405

387406
objtype = 'accessormethod'
388407
directivetype = 'method'
389408

409+
# lower than MethodDocumenter so this is not chosen for normal methods
410+
priority = 0.6
411+
390412

391413
class AccessorCallableDocumenter(AccessorLevelDocumenter, MethodDocumenter):
392414
"""
@@ -483,6 +505,7 @@ def remove_flags_docstring(app, what, name, obj, options, lines):
483505

484506
def setup(app):
485507
app.connect("autodoc-process-docstring", remove_flags_docstring)
508+
app.add_autodocumenter(AccessorDocumenter)
486509
app.add_autodocumenter(AccessorAttributeDocumenter)
487510
app.add_autodocumenter(AccessorMethodDocumenter)
488511
app.add_autodocumenter(AccessorCallableDocumenter)

0 commit comments

Comments
 (0)