text_plain_output_1.png
import matplotlib.pyplot as plt

import numpy as np # linear algebra

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import seaborn as sns

GM_df = pd.read_excel('/kaggle/input/juan-anyang/GM.xlsx')
Mining_df = pd.read_excel('/kaggle/input/juan-anyang/Mining.xlsx')
GM_df.fillna(0, inplace=True)
Mining_df.fillna(0, inplace=True)

GM_df['Reading No'] = GM_df['Reading No'].astype(str)

Mining_df['Reading No'] = Mining_df['Reading No'].astype(str)

dummies_GM = pd.get_dummies(GM_df['Type'])
GM_df = pd.concat([GM_df, dummies_GM], axis=1)
GM_df.columns

dummies_Mining = pd.get_dummies(Mining_df['Type'])
Mining_df = pd.concat([Mining_df, dummies_Mining], axis=1)
Mining_df.columns

Mining_df[['A', 'B', 'C', 'D']] = Mining_df[['A', 'B', 'C', 'D']].astype(int)

corr_Mining = Mining_df[['Level', 'Type','A','B','C','D', 'Sn', 'Pb', 'Cu', 'P', 'Cl', 'S']].corr()
f,ax = plt.subplots(figsize=(9, 9))

mask = np.zeros_like(corr_Mining, dtype=np.bool)
mask[np.triu_indices_from(mask)] = True
cmap = sns.diverging_palette(220, 10, as_cmap=True)
sns.heatmap(corr_Mining, mask=mask, cmap=cmap, square=True, annot=True, linewidths=.5, fmt= '.1f',ax=ax) 

plt.figure(figsize=(12, 5))
sns.distplot(Mining_df['Level'])