In [1]:
import numpy as np
import pandas as pd
In [2]:
np.version.version
Out[2]:
'1.8.2'
In [3]:
pd.version.version
Out[3]:
'0.14.1'
In [2]:
%load_ext snakeviz_magic
In [9]:
a = np.arange(100)
aa = np.arange(100, 200)
s = pd.Series(s)
ss = pd.Series(aa)
In [10]:
i = np.random.choice(a, size=10)
In [11]:
%timeit s[i]
10000 loops, best of 3: 166 µs per loop
In [12]:
%timeit a[i]
1000000 loops, best of 3: 1.12 µs per loop
In [13]:
%timeit s * ss
10000 loops, best of 3: 90.1 µs per loop
In [14]:
%timeit a * aa
1000000 loops, best of 3: 1.26 µs per loop
In [7]:
%snakeviz s[i]
 
*** Profile stats marshalled to file u'/var/folders/8w/36y0_wkn0_d3mkskxd7g2_200000gp/T/tmpiVkM7c'. 
In [8]:
%snakeviz a[i]
 
*** Profile stats marshalled to file u'/var/folders/8w/36y0_wkn0_d3mkskxd7g2_200000gp/T/tmpPfP8wq'. 
In [ ]: