Skip to content

Commit cd35777

Browse files
author
P-Tillmann
authored
Merge pull request pandas-dev#1 from pandas-dev/master
...
2 parents 8d197ba + c6e5bf6 commit cd35777

File tree

265 files changed

+5603
-5025
lines changed

Some content is hidden

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

265 files changed

+5603
-5025
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
- [ ] closes #xxxx
22
- [ ] tests added / passed
3-
- [ ] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` (On Windows, ``git diff upstream/master -u -- "*.py" | flake8 --diff`` might work as an alternative.)
3+
- [ ] passes ``git diff upstream/master -u -- "*.py" | flake8 --diff``
44
- [ ] whatsnew entry

.pep8speaks.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# File : .pep8speaks.yml
2+
3+
scanner:
4+
diff_only: True # If True, errors caused by only the patch are shown
5+
6+
pycodestyle:
7+
max-line-length: 79
8+
ignore: # Errors and warnings to ignore
9+
- E731
10+
- E402

asv_bench/benchmarks/rolling.py

+185
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
from .pandas_vb_common import *
2+
import pandas as pd
3+
import numpy as np
4+
5+
6+
class DataframeRolling(object):
7+
goal_time = 0.2
8+
9+
def setup(self):
10+
self.N = 100000
11+
self.Ns = 10000
12+
self.df = pd.DataFrame({'a': np.random.random(self.N)})
13+
self.dfs = pd.DataFrame({'a': np.random.random(self.Ns)})
14+
self.wins = 10
15+
self.winl = 1000
16+
17+
def time_rolling_quantile_0(self):
18+
(self.df.rolling(self.wins).quantile(0.0))
19+
20+
def time_rolling_quantile_1(self):
21+
(self.df.rolling(self.wins).quantile(1.0))
22+
23+
def time_rolling_quantile_median(self):
24+
(self.df.rolling(self.wins).quantile(0.5))
25+
26+
def time_rolling_median(self):
27+
(self.df.rolling(self.wins).median())
28+
29+
def time_rolling_mean(self):
30+
(self.df.rolling(self.wins).mean())
31+
32+
def time_rolling_max(self):
33+
(self.df.rolling(self.wins).max())
34+
35+
def time_rolling_min(self):
36+
(self.df.rolling(self.wins).min())
37+
38+
def time_rolling_std(self):
39+
(self.df.rolling(self.wins).std())
40+
41+
def time_rolling_count(self):
42+
(self.df.rolling(self.wins).count())
43+
44+
def time_rolling_skew(self):
45+
(self.df.rolling(self.wins).skew())
46+
47+
def time_rolling_kurt(self):
48+
(self.df.rolling(self.wins).kurt())
49+
50+
def time_rolling_sum(self):
51+
(self.df.rolling(self.wins).sum())
52+
53+
def time_rolling_corr(self):
54+
(self.dfs.rolling(self.wins).corr())
55+
56+
def time_rolling_cov(self):
57+
(self.dfs.rolling(self.wins).cov())
58+
59+
def time_rolling_quantile_0_l(self):
60+
(self.df.rolling(self.winl).quantile(0.0))
61+
62+
def time_rolling_quantile_1_l(self):
63+
(self.df.rolling(self.winl).quantile(1.0))
64+
65+
def time_rolling_quantile_median_l(self):
66+
(self.df.rolling(self.winl).quantile(0.5))
67+
68+
def time_rolling_median_l(self):
69+
(self.df.rolling(self.winl).median())
70+
71+
def time_rolling_mean_l(self):
72+
(self.df.rolling(self.winl).mean())
73+
74+
def time_rolling_max_l(self):
75+
(self.df.rolling(self.winl).max())
76+
77+
def time_rolling_min_l(self):
78+
(self.df.rolling(self.winl).min())
79+
80+
def time_rolling_std_l(self):
81+
(self.df.rolling(self.wins).std())
82+
83+
def time_rolling_count_l(self):
84+
(self.df.rolling(self.wins).count())
85+
86+
def time_rolling_skew_l(self):
87+
(self.df.rolling(self.wins).skew())
88+
89+
def time_rolling_kurt_l(self):
90+
(self.df.rolling(self.wins).kurt())
91+
92+
def time_rolling_sum_l(self):
93+
(self.df.rolling(self.wins).sum())
94+
95+
96+
class SeriesRolling(object):
97+
goal_time = 0.2
98+
99+
def setup(self):
100+
self.N = 100000
101+
self.Ns = 10000
102+
self.df = pd.DataFrame({'a': np.random.random(self.N)})
103+
self.dfs = pd.DataFrame({'a': np.random.random(self.Ns)})
104+
self.sr = self.df.a
105+
self.srs = self.dfs.a
106+
self.wins = 10
107+
self.winl = 1000
108+
109+
def time_rolling_quantile_0(self):
110+
(self.sr.rolling(self.wins).quantile(0.0))
111+
112+
def time_rolling_quantile_1(self):
113+
(self.sr.rolling(self.wins).quantile(1.0))
114+
115+
def time_rolling_quantile_median(self):
116+
(self.sr.rolling(self.wins).quantile(0.5))
117+
118+
def time_rolling_median(self):
119+
(self.sr.rolling(self.wins).median())
120+
121+
def time_rolling_mean(self):
122+
(self.sr.rolling(self.wins).mean())
123+
124+
def time_rolling_max(self):
125+
(self.sr.rolling(self.wins).max())
126+
127+
def time_rolling_min(self):
128+
(self.sr.rolling(self.wins).min())
129+
130+
def time_rolling_std(self):
131+
(self.sr.rolling(self.wins).std())
132+
133+
def time_rolling_count(self):
134+
(self.sr.rolling(self.wins).count())
135+
136+
def time_rolling_skew(self):
137+
(self.sr.rolling(self.wins).skew())
138+
139+
def time_rolling_kurt(self):
140+
(self.sr.rolling(self.wins).kurt())
141+
142+
def time_rolling_sum(self):
143+
(self.sr.rolling(self.wins).sum())
144+
145+
def time_rolling_corr(self):
146+
(self.srs.rolling(self.wins).corr())
147+
148+
def time_rolling_cov(self):
149+
(self.srs.rolling(self.wins).cov())
150+
151+
def time_rolling_quantile_0_l(self):
152+
(self.sr.rolling(self.winl).quantile(0.0))
153+
154+
def time_rolling_quantile_1_l(self):
155+
(self.sr.rolling(self.winl).quantile(1.0))
156+
157+
def time_rolling_quantile_median_l(self):
158+
(self.sr.rolling(self.winl).quantile(0.5))
159+
160+
def time_rolling_median_l(self):
161+
(self.sr.rolling(self.winl).median())
162+
163+
def time_rolling_mean_l(self):
164+
(self.sr.rolling(self.winl).mean())
165+
166+
def time_rolling_max_l(self):
167+
(self.sr.rolling(self.winl).max())
168+
169+
def time_rolling_min_l(self):
170+
(self.sr.rolling(self.winl).min())
171+
172+
def time_rolling_std_l(self):
173+
(self.sr.rolling(self.wins).std())
174+
175+
def time_rolling_count_l(self):
176+
(self.sr.rolling(self.wins).count())
177+
178+
def time_rolling_skew_l(self):
179+
(self.sr.rolling(self.wins).skew())
180+
181+
def time_rolling_kurt_l(self):
182+
(self.sr.rolling(self.wins).kurt())
183+
184+
def time_rolling_sum_l(self):
185+
(self.sr.rolling(self.wins).sum())

asv_bench/benchmarks/sparse.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from itertools import repeat
2+
13
from .pandas_vb_common import *
24
import scipy.sparse
35
from pandas import SparseSeries, SparseDataFrame
@@ -27,6 +29,12 @@ class sparse_frame_constructor(object):
2729
def time_sparse_frame_constructor(self):
2830
SparseDataFrame(columns=np.arange(100), index=np.arange(1000))
2931

32+
def time_sparse_from_scipy(self):
33+
SparseDataFrame(scipy.sparse.rand(1000, 1000, 0.005))
34+
35+
def time_sparse_from_dict(self):
36+
SparseDataFrame(dict(zip(range(1000), repeat([0]))))
37+
3038

3139
class sparse_series_from_coo(object):
3240
goal_time = 0.2

asv_bench/benchmarks/timeseries.py

+13-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def setup(self):
5353
self.rng6 = date_range(start='1/1/1', periods=self.N, freq='B')
5454

5555
self.rng7 = date_range(start='1/1/1700', freq='D', periods=100000)
56-
self.a = self.rng7[:50000].append(self.rng7[50002:])
56+
self.no_freq = self.rng7[:50000].append(self.rng7[50002:])
57+
self.d_freq = self.rng7[:50000].append(self.rng7[50000:])
58+
59+
self.rng8 = date_range(start='1/1/1700', freq='B', periods=100000)
60+
self.b_freq = self.rng8[:50000].append(self.rng8[50000:])
5761

5862
def time_add_timedelta(self):
5963
(self.rng + dt.timedelta(minutes=2))
@@ -94,8 +98,14 @@ def time_infer_dst(self):
9498
def time_timeseries_is_month_start(self):
9599
self.rng6.is_month_start
96100

97-
def time_infer_freq(self):
98-
infer_freq(self.a)
101+
def time_infer_freq_none(self):
102+
infer_freq(self.no_freq)
103+
104+
def time_infer_freq_daily(self):
105+
infer_freq(self.d_freq)
106+
107+
def time_infer_freq_business(self):
108+
infer_freq(self.b_freq)
99109

100110

101111
class TimeDatetimeConverter(object):

asv_bench/vbench_to_asv.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def translate_module(target_module):
114114
l_vars = {}
115115
exec('import ' + target_module) in g_vars
116116

117-
print target_module
117+
print(target_module)
118118
module = eval(target_module, g_vars)
119119

120120
benchmarks = []
@@ -157,7 +157,7 @@ def translate_module(target_module):
157157
mod = os.path.basename(module)
158158
if mod in ['make.py', 'measure_memory_consumption.py', 'perf_HEAD.py', 'run_suite.py', 'test_perf.py', 'generate_rst_files.py', 'test.py', 'suite.py']:
159159
continue
160-
print
161-
print mod
160+
print('')
161+
print(mod)
162162

163163
translate_module(mod.replace('.py', ''))

bench/alignment.py

-22
This file was deleted.

bench/bench_dense_to_sparse.py

-14
This file was deleted.

bench/bench_get_put_value.py

-56
This file was deleted.

0 commit comments

Comments
 (0)