Skip to content

Commit d97bcd7

Browse files
committed
Merge with master
2 parents 6b1a365 + fa9c7de commit d97bcd7

File tree

540 files changed

+9078
-10785
lines changed

Some content is hidden

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

540 files changed

+9078
-10785
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ dist
6161
.coverage
6262
coverage.xml
6363
coverage_html_report
64+
.mypy_cache
6465
*.pytest_cache
6566
# hypothesis test database
6667
.hypothesis/

.travis.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
sudo: false
22
language: python
3-
# Default Python version is usually 2.7
43
python: 3.5
54

65
# To turn off cached cython files and compiler cache
@@ -36,21 +35,13 @@ matrix:
3635
env:
3736
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="(not slow and not network)"
3837

39-
- dist: trusty
40-
env:
41-
- JOB="2.7" ENV_FILE="ci/deps/travis-27.yaml" PATTERN="(not slow or (single and db))"
42-
addons:
43-
apt:
44-
packages:
45-
- python-gtk2
46-
4738
- dist: trusty
4839
env:
4940
- JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="((not slow and not network) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8"
5041

5142
- dist: trusty
5243
env:
53-
- JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36.yaml" PATTERN="((not slow and not network) or (single and db))" PANDAS_TESTING_MODE="deprecate" COVERAGE=true
44+
- JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36-cov.yaml" PATTERN="((not slow and not network) or (single and db))" PANDAS_TESTING_MODE="deprecate" COVERAGE=true
5445

5546
# In allow_failures
5647
- dist: trusty
@@ -91,15 +82,10 @@ before_install:
9182
install:
9283
- echo "install start"
9384
- ci/prep_cython_cache.sh
94-
- ci/install_travis.sh
85+
- ci/setup_env.sh
9586
- ci/submit_cython_cache.sh
9687
- echo "install done"
9788

98-
before_script:
99-
- ci/install_db_travis.sh
100-
- export DISPLAY=":99.0"
101-
- ci/before_script_travis.sh
102-
10389
script:
10490
- echo "script start"
10591
- source activate pandas-dev

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
<td>Package Status</td>
2727
<td>
2828
<a href="https://pypi.org/project/pandas/">
29-
<img src="https://img.shields.io/pypi/status/pandas.svg" alt="status" /></td>
29+
<img src="https://img.shields.io/pypi/status/pandas.svg" alt="status" />
3030
</a>
31+
</td>
3132
</tr>
3233
<tr>
3334
<td>License</td>
@@ -73,8 +74,8 @@
7374
<td>Gitter</td>
7475
<td>
7576
<a href="https://gitter.im/pydata/pandas">
76-
<img src="https://badges.gitter.im/Join%20Chat.svg"
77-
</a>
77+
<img src="https://badges.gitter.im/Join%20Chat.svg" />
78+
</a>
7879
</td>
7980
</tr>
8081
</table>
@@ -163,9 +164,9 @@ pip install pandas
163164
```
164165

165166
## Dependencies
166-
- [NumPy](https://www.numpy.org): 1.12.0 or higher
167+
- [NumPy](https://www.numpy.org): 1.13.3 or higher
167168
- [python-dateutil](https://labix.org/python-dateutil): 2.5.0 or higher
168-
- [pytz](https://pythonhosted.org/pytz): 2011k or higher
169+
- [pytz](https://pythonhosted.org/pytz): 2015.4 or higher
169170

170171
See the [full installation instructions](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies)
171172
for recommended and optional dependencies.

asv_bench/benchmarks/indexing.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import numpy as np
44
import pandas.util.testing as tm
5-
from pandas import (Series, DataFrame, Panel, MultiIndex,
5+
from pandas import (Series, DataFrame, MultiIndex,
66
Int64Index, UInt64Index, Float64Index,
77
IntervalIndex, CategoricalIndex,
88
IndexSlice, concat, date_range)
@@ -277,18 +277,6 @@ def time_get_indexer_list(self, index):
277277
self.data.get_indexer(self.cat_list)
278278

279279

280-
class PanelIndexing(object):
281-
282-
def setup(self):
283-
with warnings.catch_warnings(record=True):
284-
self.p = Panel(np.random.randn(100, 100, 100))
285-
self.inds = range(0, 100, 10)
286-
287-
def time_subset(self):
288-
with warnings.catch_warnings(record=True):
289-
self.p.ix[(self.inds, self.inds, self.inds)]
290-
291-
292280
class MethodLookup(object):
293281

294282
def setup_cache(self):

asv_bench/benchmarks/io/csv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import numpy as np
55
import pandas.util.testing as tm
66
from pandas import DataFrame, Categorical, date_range, read_csv
7-
from pandas.compat import cStringIO as StringIO
7+
from io import StringIO
88

99
from ..pandas_vb_common import BaseIO
1010

asv_bench/benchmarks/io/excel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
from io import BytesIO
12
import numpy as np
23
from pandas import DataFrame, date_range, ExcelWriter, read_excel
3-
from pandas.compat import BytesIO
44
import pandas.util.testing as tm
55

66

asv_bench/benchmarks/io/stata.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ class Stata(BaseIO):
1212

1313
def setup(self, convert_dates):
1414
self.fname = '__test__.dta'
15-
N = 100000
16-
C = 5
15+
N = self.N = 100000
16+
C = self.C = 5
1717
self.df = DataFrame(np.random.randn(N, C),
1818
columns=['float{}'.format(i) for i in range(C)],
1919
index=date_range('20000101', periods=N, freq='H'))
20-
self.df['object'] = tm.makeStringIndex(N)
20+
self.df['object'] = tm.makeStringIndex(self.N)
2121
self.df['int8_'] = np.random.randint(np.iinfo(np.int8).min,
2222
np.iinfo(np.int8).max - 27, N)
2323
self.df['int16_'] = np.random.randint(np.iinfo(np.int16).min,
@@ -36,4 +36,14 @@ def time_write_stata(self, convert_dates):
3636
self.df.to_stata(self.fname, self.convert_dates)
3737

3838

39+
class StataMissing(Stata):
40+
def setup(self, convert_dates):
41+
super(StataMissing, self).setup(convert_dates)
42+
for i in range(10):
43+
missing_data = np.random.randn(self.N)
44+
missing_data[missing_data < 0] = np.nan
45+
self.df['missing_{0}'.format(i)] = missing_data
46+
self.df.to_stata(self.fname, self.convert_dates)
47+
48+
3949
from ..pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/join_merge.py

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import warnings
21
import string
32

43
import numpy as np
54
import pandas.util.testing as tm
6-
from pandas import (DataFrame, Series, Panel, MultiIndex,
5+
from pandas import (DataFrame, Series, MultiIndex,
76
date_range, concat, merge, merge_asof)
87

98
try:
@@ -66,31 +65,6 @@ def time_concat_mixed_ndims(self, axis):
6665
concat(self.mixed_ndims, axis=axis)
6766

6867

69-
class ConcatPanels(object):
70-
71-
params = ([0, 1, 2], [True, False])
72-
param_names = ['axis', 'ignore_index']
73-
74-
def setup(self, axis, ignore_index):
75-
with warnings.catch_warnings(record=True):
76-
panel_c = Panel(np.zeros((10000, 200, 2),
77-
dtype=np.float32,
78-
order='C'))
79-
self.panels_c = [panel_c] * 20
80-
panel_f = Panel(np.zeros((10000, 200, 2),
81-
dtype=np.float32,
82-
order='F'))
83-
self.panels_f = [panel_f] * 20
84-
85-
def time_c_ordered(self, axis, ignore_index):
86-
with warnings.catch_warnings(record=True):
87-
concat(self.panels_c, axis=axis, ignore_index=ignore_index)
88-
89-
def time_f_ordered(self, axis, ignore_index):
90-
with warnings.catch_warnings(record=True):
91-
concat(self.panels_f, axis=axis, ignore_index=ignore_index)
92-
93-
9468
class ConcatDataFrames(object):
9569

9670
params = ([0, 1], [True, False])

asv_bench/benchmarks/panel_ctor.py

Lines changed: 0 additions & 55 deletions
This file was deleted.

asv_bench/benchmarks/panel_methods.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

asv_bench/benchmarks/rolling.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,20 @@ def time_quantile(self, constructor, window, dtype, percentile,
113113
self.roll.quantile(percentile, interpolation=interpolation)
114114

115115

116+
class PeakMemFixed(object):
117+
118+
def setup(self):
119+
N = 10
120+
arr = 100 * np.random.random(N)
121+
self.roll = pd.Series(arr).rolling(10)
122+
123+
def peakmem_fixed(self):
124+
# GH 25926
125+
# This is to detect memory leaks in rolling operations.
126+
# To save time this is only ran on one method.
127+
# 6000 iterations is enough for most types of leaks to be detected
128+
for x in range(6000):
129+
self.roll.max()
130+
131+
116132
from .pandas_vb_common import setup # noqa: F401

azure-pipelines.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
name: Linux
1111
vmImage: ubuntu-16.04
1212

13-
# Windows Python 2.7 needs VC 9.0 installed, handled in the template
1413
- template: ci/azure/windows.yml
1514
parameters:
1615
name: Windows
@@ -40,9 +39,8 @@ jobs:
4039
- script: |
4140
export PATH=$HOME/miniconda3/bin:$PATH
4241
sudo apt-get install -y libc6-dev-i386
43-
ci/incremental/install_miniconda.sh
44-
ci/incremental/setup_conda_environment.sh
45-
displayName: 'Set up environment'
42+
ci/setup_env.sh
43+
displayName: 'Setup environment and build pandas'
4644
condition: true
4745
4846
# Do not require pandas
@@ -60,13 +58,6 @@ jobs:
6058
displayName: 'Dependencies consistency'
6159
condition: true
6260
63-
- script: |
64-
export PATH=$HOME/miniconda3/bin:$PATH
65-
source activate pandas-dev
66-
ci/incremental/build.sh
67-
displayName: 'Build'
68-
condition: true
69-
7061
# Require pandas
7162
- script: |
7263
export PATH=$HOME/miniconda3/bin:$PATH
@@ -89,6 +80,13 @@ jobs:
8980
displayName: 'Docstring validation'
9081
condition: true
9182
83+
- script: |
84+
export PATH=$HOME/miniconda3/bin:$PATH
85+
source activate pandas-dev
86+
ci/code_checks.sh typing
87+
displayName: 'Typing validation'
88+
condition: true
89+
9290
- script: |
9391
export PATH=$HOME/miniconda3/bin:$PATH
9492
source activate pandas-dev

0 commit comments

Comments
 (0)