<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Title
Step1:  Load Data
Step2:  Identify Highly Correlated Features
Step3:  Drop Marked Features
<ASSISTANT_TASK:>
Python Code:
# Load libraries
import pandas as pd
import numpy as np
Explanation: Title: Drop Highly Correlated Features
Slug: drop_highly_correlated_features
Summary: How to drop highly correlated features for machine learning in Python.  
Date: 2017-09-14 12:00
Category: Machine Learning
Tags: Feature Selection
Authors: Chris Albon
Preliminaries
End of explanation
# Create feature matrix with two highly correlated features
X = np.array([[1, 1, 1],
              [2, 2, 0],
              [3, 3, 1],
              [4, 4, 0],
              [5, 5, 1],
              [6, 6, 0],
              [7, 7, 1],
              [8, 7, 0],
              [9, 7, 1]])
# Convert feature matrix into DataFrame
df = pd.DataFrame(X)
# View the data frame
df
Explanation: Load Data
End of explanation
# Create correlation matrix
corr_matrix = df.corr().abs()
# Select upper triangle of correlation matrix
upper = corr_matrix.where(np.triu(np.ones(corr_matrix.shape), k=1).astype(np.bool))
# Find index of feature columns with correlation greater than 0.95
to_drop = [column for column in upper.columns if any(upper[column] > 0.95)]
Explanation: Identify Highly Correlated Features
End of explanation
# Drop features 
df.drop(df.columns[to_drop], axis=1)
Explanation: Drop Marked Features
End of explanation
<END_TASK>