We need to prepare our environment as follows:
- From the command console, install pandas and numpy with the following commands:
pip install pandas
pip install numpy
pip install matplotlib
pip install seaborn
pip install scipy
pip install keras
- Download NASA's dataset in a folder named, data
- In the same directory, create a new file called my_prognostic.py
- Finally, write the following lines of code to import the data:
import pandas as pd
import numpy as np
# read the dataset
columns = ['unitid', 'time', 'set_1','set_2','set_3']
columns.extend(['sensor_' + str(i) for i in range(1,22)])
df = pd.read_csv('./data/train_FD001.txt', delim_whitespace=True,names=columns)
print(df.head())
- From the command console, run the algorithm:
python my_prognostic.py