In [234]:
drive_path = 'c:/'
import numpy as np
import pandas as pd
import os
import sys
import matplotlib.pyplot as plt
%matplotlib
%pylab inline
from scipy.stats import ks_2samp
from scipy.stats import anderson_ksamp
from scipy.stats import kruskal
from scipy.stats import variation
from scipy import signal
import seaborn as sns


Using matplotlib backend: Qt4Agg

In [239]:
from scipy import signal

In [235]:
names=['Plane','Time','Elapsed (ms)']
names.extend([col for col in df.columns if 'G PMT' in col])
df=pd.read_table('C:\\Users\Annie\Desktop\\160621_1_Notepad\\2.txt',skiprows=4)
df=df.loc[df.Plane != 0,df.columns.isin(names)]
df.head()


Out[235]:
Plane Time Elapsed (ms) G PMT (1) G PMT (2) G PMT (3) G PMT (4) G PMT (5) G PMT (6) G PMT (7) G PMT (8) G PMT (9) G PMT (10) G PMT (11) G PMT (12) G PMT (13) G PMT (14)
1 1 09:55:25 165 1310.932 1134.720 1375.670 1759.653 1726.413 1024.716 820.900 1111.946 850.824 690.523 2888.812 764.946 1377.105 1268.311
2 2 09:55:25 330 1269.739 1100.187 1414.522 1802.143 1775.746 985.765 773.489 1101.351 871.412 698.963 2761.536 710.986 1401.905 1207.291
3 3 09:55:25 495 1275.511 1053.187 1321.687 1760.020 1610.571 979.481 795.878 1069.486 849.294 664.826 2788.232 715.243 1337.552 1220.000
4 4 09:55:25 660 1243.943 1109.853 1318.626 1748.939 1621.190 975.444 779.278 1100.586 847.941 653.679 2823.928 716.027 1364.914 1209.783
5 5 09:55:25 825 1258.489 1077.080 1357.252 1671.061 1602.476 976.198 799.433 1059.919 856.162 705.092 2733.957 737.365 1381.657 1207.126

In [236]:
odf=df[[col for col in df.columns if 'G PMT' in col]]
odf.head()


Out[236]:
G PMT (1) G PMT (2) G PMT (3) G PMT (4) G PMT (5) G PMT (6) G PMT (7) G PMT (8) G PMT (9) G PMT (10) G PMT (11) G PMT (12) G PMT (13) G PMT (14)
1 1310.932 1134.720 1375.670 1759.653 1726.413 1024.716 820.900 1111.946 850.824 690.523 2888.812 764.946 1377.105 1268.311
2 1269.739 1100.187 1414.522 1802.143 1775.746 985.765 773.489 1101.351 871.412 698.963 2761.536 710.986 1401.905 1207.291
3 1275.511 1053.187 1321.687 1760.020 1610.571 979.481 795.878 1069.486 849.294 664.826 2788.232 715.243 1337.552 1220.000
4 1243.943 1109.853 1318.626 1748.939 1621.190 975.444 779.278 1100.586 847.941 653.679 2823.928 716.027 1364.914 1209.783
5 1258.489 1077.080 1357.252 1671.061 1602.476 976.198 799.433 1059.919 856.162 705.092 2733.957 737.365 1381.657 1207.126

In [237]:
plt.figure();
plt.plot(df[[col for col in df.columns if 'G PMT' in col]]);



In [245]:
detrend(odf);

In [246]:
plt.figure();
plt.plot(odf_dt);



In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [133]:
import thunder as td

In [147]:
td.series.fromexample('fish')


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-147-0b939e41979f> in <module>()
----> 1 td.series.fromexample('fish')

C:\Users\Annie\Anaconda2\lib\site-packages\thunder\series\readers.pyc in fromexample(name, engine)
    436             if not key.name.endswith('/'):
    437                 key.get_contents_to_filename(os.path.join(d, key.name))
--> 438         data = frombinary(os.path.join(d, 'series', name), engine=engine)
    439 
    440         if spark and isinstance(engine, spark):

C:\Users\Annie\Anaconda2\lib\site-packages\thunder\series\readers.pyc in frombinary(path, ext, conf, dtype, shape, skip, index, labels, engine, credentials)
    290         Credentials for remote storage (e.g. S3) in the form {access: ***, secret: ***}
    291     """
--> 292     shape, dtype = _binaryconfig(path, conf, dtype, shape, credentials)
    293 
    294     from thunder.readers import normalize_scheme, get_parallel_reader

C:\Users\Annie\Anaconda2\lib\site-packages\thunder\series\readers.pyc in _binaryconfig(path, conf, dtype, shape, credentials)
    363 
    364     if 'dtype' not in params.keys():
--> 365         raise ValueError('dtype not specified either in conf.json or as argument')
    366 
    367     if 'shape' not in params.keys():

ValueError: dtype not specified either in conf.json or as argument

In [143]:



---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-143-31372f3aef9c> in <module>()
----> 1 td.series.fromexample('iris')

C:\Users\Annie\Anaconda2\lib\site-packages\thunder\series\readers.pyc in fromexample(name, engine)
    436             if not key.name.endswith('/'):
    437                 key.get_contents_to_filename(os.path.join(d, key.name))
--> 438         data = frombinary(os.path.join(d, 'series', name), engine=engine)
    439 
    440         if spark and isinstance(engine, spark):

C:\Users\Annie\Anaconda2\lib\site-packages\thunder\series\readers.pyc in frombinary(path, ext, conf, dtype, shape, skip, index, labels, engine, credentials)
    290         Credentials for remote storage (e.g. S3) in the form {access: ***, secret: ***}
    291     """
--> 292     shape, dtype = _binaryconfig(path, conf, dtype, shape, credentials)
    293 
    294     from thunder.readers import normalize_scheme, get_parallel_reader

C:\Users\Annie\Anaconda2\lib\site-packages\thunder\series\readers.pyc in _binaryconfig(path, conf, dtype, shape, credentials)
    363 
    364     if 'dtype' not in params.keys():
--> 365         raise ValueError('dtype not specified either in conf.json or as argument')
    366 
    367     if 'shape' not in params.keys():

ValueError: dtype not specified either in conf.json or as argument

In [ ]: