forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseries_methods.py
29 lines (24 loc) · 1.12 KB
/
series_methods.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from vbench.api import Benchmark
from datetime import datetime
common_setup = """from pandas_vb_common import *
"""
setup = common_setup + """
s1 = Series(np.random.randn(10000))
s2 = Series(np.random.randint(1, 10, 10000))
"""
series_nlargest1 = Benchmark('s1.nlargest(3, take_last=True);'
's1.nlargest(3, take_last=False)',
setup,
start_date=datetime(2014, 1, 25))
series_nlargest2 = Benchmark('s2.nlargest(3, take_last=True);'
's2.nlargest(3, take_last=False)',
setup,
start_date=datetime(2014, 1, 25))
series_nsmallest2 = Benchmark('s1.nsmallest(3, take_last=True);'
's1.nsmallest(3, take_last=False)',
setup,
start_date=datetime(2014, 1, 25))
series_nsmallest2 = Benchmark('s2.nsmallest(3, take_last=True);'
's2.nsmallest(3, take_last=False)',
setup,
start_date=datetime(2014, 1, 25))