Putting Everything Together!
Let's put all the concepts together regarding feature engineering,
We'll cover the following...
In this lesson, we will apply feature engineering to a small dataset. You will use all the techniques that have been presented in the previous lessons. On each step, you also have the choice to apply other similar data processing techniques.
First, we start by taking the library and importing the data.
Press + to interact
main.py
data_feature_engineering.csv
#Import pandas libraryimport pandas#Read datadata = pandas.read_csv("data_feature_engineering.csv")#We convert the Date_of_action feature to pandas datetimedata['Date_Of_Action'] = pandas.to_datetime(data['Date_Of_Action'], infer_datetime_format=True)#Create is_Weekend featuredata['is_Weekend'] = (data['Date_Of_Action'].dt.dayofweek // 5 == 1).astype(int)#print top 10 rowsprint(data.head(10))
In the above code, we have imported a ...