UniTO/anno2/YearI/SecondSem/BDM/progetto/newsource/gw.py
Francesco Mecca 5e286062f8 MCAD 2019
2018-11-22 13:09:11 +01:00

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"])