BLarzalere / LSTM-Autoencoder-for-Anomaly-Detection

AI deep learning neural network for anomaly detection using Python, Keras and TensorFlow
192 stars 75 forks source link

Failed in Data Set Reading #1

Open htcml opened 4 years ago

htcml commented 4 years ago

Your program simply failed in data reading step. Please fix it.

data_dir = 'data/bearing_data' merged_data = pd.DataFrame()

for filename in os.listdir(data_dir): dataset = pd.read_csv(os.path.join(data_dir, filename), sep='\t') dataset_mean_abs = np.array(dataset.abs().mean()) dataset_mean_abs = pd.DataFrame(dataset_mean_abs.reshape(1,4)) dataset_mean_abs.index = [filename] merged_data = merged_data.append(dataset_mean_abs)

merged_data.columns = ['Bearing 1', 'Bearing 2', 'Bearing 3', 'Bearing 4']

gmineo commented 4 years ago

Dear Brent, I 've the same prolem. Could you pleae fix it? Thank you and best regards, Gabriele

gmineo commented 4 years ago

I've found the following solution that perfectly worked for me:

data_dir = 'data/bearing_data' merged_data = pd.DataFrame()

for filename in os.listdir(data_dir): if filename not in ('.ipynb_checkpoints'): dataset = pd.read_csv(os.path.join(data_dir, filename), sep='\t', encoding='utf-8', engine='python') dataset_mean_abs = np.array(dataset.abs().mean()) dataset_mean_abs = pd.DataFrame(dataset_mean_abs.reshape(1,4)) dataset_mean_abs.index = [filename] merged_data = merged_data.append(dataset_mean_abs)