Open htcml opened 4 years ago
Dear Brent, I 've the same prolem. Could you pleae fix it? Thank you and best regards, Gabriele
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)
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']