36 lines
940 B
Python
36 lines
940 B
Python
import pandas as pd
|
|
from scipy import stats
|
|
# import sklearn as sk
|
|
# import sklearn.preprocessing as skpre
|
|
import numpy as np
|
|
from sys import argv
|
|
import argparse
|
|
|
|
import libword
|
|
|
|
def parseArgs(argv):
|
|
parser = argparse.ArgumentParser(description='ex1')
|
|
parser.add_argument('--datadir','-d', type=str,
|
|
help='directory for data files')
|
|
parser.add_argument('--window','-w', type=int,
|
|
help='window')
|
|
parser.add_argument('--shift','-s', type=int,
|
|
help='shift')
|
|
parser.add_argument('--resolution','-r', type=int,
|
|
help='resolution')
|
|
|
|
args = parser.parse_args()
|
|
return vars(args)
|
|
|
|
def readDatadir(datadir):
|
|
import glob
|
|
frames = list()
|
|
for dfile in glob.glob(datadir+"/*/*.csv"):
|
|
tmp = libword.read_csv(dfile)
|
|
frames.append(tmp)
|
|
return frames
|
|
|
|
if __name__ == '__main__':
|
|
args = parseArgs(argv)
|
|
dfIter = readDatadir(args["datadir"])
|
|
|