File: attrs_caching.py

package info (click to toggle)
pandas 0.13.1-2~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 48,044 kB
  • sloc: python: 115,757; ansic: 11,490; sh: 311; makefile: 120
file content (20 lines) | stat: -rw-r--r-- 597 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from vbench.benchmark import Benchmark

common_setup = """from pandas_vb_common import *
"""

#----------------------------------------------------------------------
# DataFrame.index / columns property lookup time

setup = common_setup + """
df = DataFrame(np.random.randn(10, 6))
cur_index = df.index
"""
stmt = "foo = df.index"

getattr_dataframe_index = Benchmark(stmt, setup,
                                    name="getattr_dataframe_index")

stmt = "df.index = cur_index"
setattr_dataframe_index = Benchmark(stmt, setup,
                                    name="setattr_dataframe_index")