<jupyter_start><jupyter_text>Save data from test 2 dataset (NASA)<jupyter_code>import numpy as np
import scipy.io as sio
import pandas as pd
from os import listdir
signals_Ch1 = []
signals_Ch2 = []
signals_Ch3 = []
signals_Ch4 = []
signals_Ch5 = []
signals_Ch6 = []
n_files = len(listdir("../1st_test"))
cont = 0
for file in listdir("../1st_test"):
    file = '../1st_test/' + file
    df = pd.read_csv(file, sep = '\t', header = None)
    df.columns = ['Ch1', 'Ch2', 'Ch3', 'Ch4', 'Ch5', 'Ch6', 'Ch7', 'Ch8']
    cont += 1
    print(str(cont) + ' files read out of ' + str(n_files))
    signals_Ch1.append(df.Ch1.values)
    signals_Ch2.append(df.Ch2.values)
    signals_Ch3.append(df.Ch3.values)
    signals_Ch4.append(df.Ch4.values)
    signals_Ch5.append(df.Ch5.values)
    signals_Ch6.append(df.Ch6.values)
signals_test1 = pd.DataFrame({'Ch1': signals_Ch1, 'Ch2': signals_Ch2, 'Ch3': signals_Ch3, 'Ch4': signals_Ch4,
                              'Ch5': signals_Ch5, 'Ch6': signals_Ch6})
signals_test1<jupyter_output><empty_output><jupyter_text>We group all data by channel:<jupyter_code>canal1 = signals_test1['Ch1']
canal1 = np.concatenate(canal1[0:])
canal2 = signals_test1['Ch2']
canal2 = np.concatenate(canal2[0:])
canal3 = signals_test1['Ch3']
canal3 = np.concatenate(canal3[0:])
canal4 = signals_test1['Ch4']
canal4 = np.concatenate(canal4[0:])
canal5 = signals_test1['Ch5']
canal5 = np.concatenate(canal5[0:])
canal6 = signals_test1['Ch6']
canal6 = np.concatenate(canal6[0:])
sio.savemat('./DataSignals/signals_test1_channels.mat', {'Ch1': canal1, 'Ch2': canal2, 'Ch3': canal3, 'Ch4': canal4, 
                                           'Ch5': canal5, 'Ch6': canal6})<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1654970760233918, 'fraction_numerical': 0.05555555555555555, 'mean_word_length': 4.2972136222910216, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '139561', 'license': 'MIT', 'n_tokens_mistral': 710, 'n_tokens_neox': 709, 'n_words': 123, 'path': 'TimeToFailurePrediction/DataVisualization/Data_test1.ipynb', 'repo_name': 'judithspd/predictive-maintenance', 'size': '1710'}