text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

mapdata1 = pd.read_csv('../input/surviving-mars-maps/MapData-Evans-GP-Flatten.csv')
mapdata2 = pd.read_csv('../input/surviving-mars-maps/MapData-Evans-GP.csv')

mapdata1.shape

bl_col = mapdata1.select_dtypes(include='boolean')
int_col = mapdata1.select_dtypes(include='int').columns
str_col = mapdata1.select_dtypes(include='object').columns

sh = mapdata1.select_dtypes(exclude='boolean')
sh

x_data = sh.drop(['Temperature', 'Cold Waves'], axis='columns')

x_data.corr()

def correlation(x_data, threshold):
    col_corr = set()
    corr_matrix = x_data.corr()
    for i in range(len(corr_matrix.columns)):
        for j in range(i):
            if corr_matrix.iloc[i, j] >= threshold and corr_matrix.columns[j] not in col_corr:
                colname = corr_matrix.columns[i]
                col_corr.add(colname)
                if colname in x_data.columns:
                    del x_data[colname]

x_data.shape