Skip to content

Commit 5e16157

Browse files
committed
Merge remote-tracking branch 'upstream/master' into depr-converter
2 parents 61fbdbb + 8d04daf commit 5e16157

File tree

153 files changed

+4931
-2848
lines changed

Some content is hidden

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

153 files changed

+4931
-2848
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,3 @@ doc/build/html/index.html
106106
doc/tmp.sv
107107
doc/source/styled.xlsx
108108
doc/source/templates/
109-
doc/source/savefig/

asv_bench/benchmarks/frame_ctor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def setup(self, offset, n_steps):
132132
offset = getattr(offsets, offset)
133133
self.idx = get_index_for_offset(offset(n_steps, **kwargs))
134134
self.df = DataFrame(np.random.randn(len(self.idx), 10), index=self.idx)
135-
self.d = dict([(col, self.df[col]) for col in self.df.columns])
135+
self.d = dict(self.df.items())
136136

137137
def time_frame_ctor(self, offset, n_steps):
138138
DataFrame(self.d)

asv_bench/benchmarks/io_bench.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class read_json_lines(object):
202202
def setup(self):
203203
self.N = 100000
204204
self.C = 5
205-
self.df = DataFrame(dict([('float{0}'.format(i), randn(self.N)) for i in range(self.C)]))
205+
self.df = DataFrame({('float{0}'.format(i), randn(self.N)) for i in range(self.C)})
206206
self.df.to_json(self.fname,orient="records",lines=True)
207207

208208
def teardown(self):

asv_bench/benchmarks/packers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def _setup(self):
1717
self.N = 100000
1818
self.C = 5
1919
self.index = date_range('20000101', periods=self.N, freq='H')
20-
self.df = DataFrame(dict([('float{0}'.format(i), randn(self.N)) for i in range(self.C)]), index=self.index)
20+
self.df = DataFrame(dict(('float{0}'.format(i), randn(self.N)) for i in range(self.C)), index=self.index)
2121
self.df2 = self.df.copy()
2222
self.df2['object'] = [('%08x' % randrange((16 ** 8))) for _ in range(self.N)]
2323
self.remove(self.f)

asv_bench/benchmarks/plotting.py

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,47 @@ def date_range(start=None, end=None, periods=None, freq=None):
1010
from pandas.tools.plotting import andrews_curves
1111

1212

13+
class Plotting(object):
14+
goal_time = 0.2
15+
16+
def setup(self):
17+
import matplotlib
18+
matplotlib.use('Agg')
19+
self.s = Series(np.random.randn(1000000))
20+
self.df = DataFrame({'col': self.s})
21+
22+
def time_series_plot(self):
23+
self.s.plot()
24+
25+
def time_frame_plot(self):
26+
self.df.plot()
27+
28+
1329
class TimeseriesPlotting(object):
1430
goal_time = 0.2
1531

1632
def setup(self):
1733
import matplotlib
1834
matplotlib.use('Agg')
19-
self.N = 2000
20-
self.M = 5
21-
self.df = DataFrame(np.random.randn(self.N, self.M), index=date_range('1/1/1975', periods=self.N))
35+
N = 2000
36+
M = 5
37+
idx = date_range('1/1/1975', periods=N)
38+
self.df = DataFrame(np.random.randn(N, M), index=idx)
39+
40+
idx_irregular = pd.DatetimeIndex(np.concatenate((idx.values[0:10],
41+
idx.values[12:])))
42+
self.df2 = DataFrame(np.random.randn(len(idx_irregular), M),
43+
index=idx_irregular)
2244

2345
def time_plot_regular(self):
2446
self.df.plot()
2547

2648
def time_plot_regular_compat(self):
2749
self.df.plot(x_compat=True)
2850

51+
def time_plot_irregular(self):
52+
self.df2.plot()
53+
2954

3055
class Misc(object):
3156
goal_time = 0.6

asv_bench/vbench_to_asv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def visit_ClassDef(self, node):
6969
return node
7070

7171
def visit_TryExcept(self, node):
72-
if any([isinstance(x, (ast.Import, ast.ImportFrom)) for x in node.body]):
72+
if any(isinstance(x, (ast.Import, ast.ImportFrom)) for x in node.body):
7373
self.imports.append(node)
7474
else:
7575
self.generic_visit(node)

ci/lint.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,31 @@ if [ "$LINT" ]; then
7272
echo "Linting *.c and *.h DONE"
7373

7474
echo "Check for invalid testing"
75-
grep -r -E --include '*.py' --exclude testing.py '(numpy|np)\.testing' pandas
75+
76+
# Check for the following code in testing:
77+
#
78+
# np.testing
79+
# np.array_equal
80+
grep -r -E --include '*.py' --exclude testing.py '(numpy|np)(\.testing|\.array_equal)' pandas/tests/
81+
7682
if [ $? = "0" ]; then
7783
RET=1
7884
fi
7985
echo "Check for invalid testing DONE"
8086

87+
echo "Check for use of lists instead of generators in built-in Python functions"
88+
89+
# Example: Avoid `any([i for i in some_iterator])` in favor of `any(i for i in some_iterator)`
90+
#
91+
# Check the following functions:
92+
# any(), all(), sum(), max(), min(), list(), dict(), set(), frozenset(), tuple(), str.join()
93+
grep -R --include="*.py*" -E "[^_](any|all|sum|max|min|list|dict|set|frozenset|tuple|join)\(\[.* for .* in .*\]\)"
94+
95+
if [ $? = "0" ]; then
96+
RET=1
97+
fi
98+
echo "Check for use of lists instead of generators in built-in Python functions DONE"
99+
81100
else
82101
echo "NOT Linting"
83102
fi

ci/requirements-3.6.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
source activate pandas
4+
5+
echo "[install 3.6 downstream deps]"
6+
7+
conda install -n pandas -c conda-forge pandas-datareader xarray geopandas seaborn statsmodels scikit-learn dask

ci/requirements-3.6_NUMPY_DEV.build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf
1212
pip install --pre --upgrade --timeout=60 -f $PRE_WHEELS numpy scipy
1313

1414
# install dateutil from master
15-
pip install -U git+git://github.com/dateutil/dateutil.git
15+
# pip install -U git+git://github.com/dateutil/dateutil.git
16+
pip install dateutil
1617

1718
# cython via pip
1819
pip install cython

ci/script_multi.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/bash -e
22

33
echo "[script multi]"
44

0 commit comments

Comments
 (0)