Page MenuHomec4science

process_synthetic_data.py
No OneTemporary

File Metadata

Created
Fri, Jul 26, 08:26

process_synthetic_data.py

import csv
import numpy as np
import pandas as pd
def interpolate(path, mode, n):
print("\033[1;37;48m Interpolating missing values in the file ", str(n), '...')
df = pd.read_table(path + 'files_missingdata_' + str(i) + '/' + mode + '/input/file_0.txt', delimiter=' ',
dtype='float32', header=None)
df = df.apply(lambda x: x.interpolate(method='index', axis=0, limit_direction='both')).astype(float)
print(df.head(5))
#df.to_csv(path + '/Signals' + str(i) + '.txt', sep=';', header=False)
path = '../../synthetic_data/'
mode = 'train'
interpolate(path, mode, 30)

Event Timeline