...

/

Putting Everything Together!

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 library
import pandas
#Read data
data = pandas.read_csv("data_feature_engineering.csv")
#We convert the Date_of_action feature to pandas datetime
data['Date_Of_Action'] = pandas.to_datetime(data['Date_Of_Action'], infer_datetime_format=True)
#Create is_Weekend feature
data['is_Weekend'] = (data['Date_Of_Action'].dt.dayofweek // 5 == 1).astype(int)
#print top 10 rows
print(data.head(10))

In the above code, we have imported a ...