In [1]:
from _corr import ccor


Generating LALR tables
---------------------------------------------------------------------------
SystemError                               Traceback (most recent call last)
<ipython-input-1-676030bade8b> in <module>()
----> 1 from _corr import ccor

/Users/yuhantang/CS207/TimeSeries/procs/_corr.py in <module>()
      6 import sys
      7 #sys.path.append("/Users/yuhantang/CS207/TimeSeries/procs")
----> 8 from .interface import *
      9 
     10 def createfromlist(l):

SystemError: Parent module '' not loaded, cannot perform relative import

In [3]:
import sys
sys.path.append("/Users/yuhantang/CS207/TimeSeries/procs")

In [4]:
from _corr import ccor


---------------------------------------------------------------------------
SystemError                               Traceback (most recent call last)
<ipython-input-4-676030bade8b> in <module>()
----> 1 from _corr import ccor

/Users/yuhantang/CS207/TimeSeries/procs/_corr.py in <module>()
      6 import sys
      7 #sys.path.append("/Users/yuhantang/CS207/TimeSeries/procs")
----> 8 from .interface import *
      9 
     10 def createfromlist(l):

SystemError: Parent module '' not loaded, cannot perform relative import

In [38]:
from interface import *
from timeseries import TimeSeries as ts
import numpy as np
import time

In [25]:
from procs import _corr

In [21]:
ts1 = ts(range(0,100),range(0,100))
ts2 = ts(np.random.randint(0,10000,size = 100),np.random.randint(0,10000,size = 100))

In [31]:
ts2.values()


Out[31]:
array([9247,  532, 9359, 6259, 1143, 5522,  748, 5035, 8027, 2321, 5043,
       3084,  623, 4000, 7039, 6786,  774, 8633, 9461, 6355, 2235, 7898,
       4598, 7691,  933, 6471, 7549,  552, 2745, 3280,  370,  819, 8911,
       1094, 9439, 3015, 2992, 1351, 8609, 1039, 2653, 2684, 5265, 6566,
       1508, 2890, 7196, 3394, 9835, 6359, 2320, 2098,  698, 6738, 7847,
         62, 7621, 4885, 9011, 7616, 6550, 3042, 9517, 7974, 2763, 1431,
       3635, 1460, 7229, 7460, 9529, 5494, 2769, 7059, 3570, 2782,  746,
       1010, 4797, 7140, 8152, 1489, 4287, 2799, 9572, 9922, 3748, 8445,
       9946, 1743, 3905,  705, 9544, 8934, 4210,  641, 4270, 9408, 1866,
       5542])

In [37]:
start = time.time()
for i in range(10000):
    _corr.ccor(ts1,ts2)
print('Test Time is')


CPU times: user 2 µs, sys: 0 ns, total: 2 µs
Wall time: 4.05 µs
Out[37]:
'Test Time'

In [ ]:


In [ ]:
%time