This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#load data -------------------- | |
df = pd.read_csv('analytes.csv') | |
df_ml = df[['MASTERID'] + [col for col in df if 'ICP' in col]] | |
#train-test split ------------------------------------------------------------- | |
X = df_ml.loc[:, ~df_ml.columns.isin(['Cu_ICP_PPM'])].drop('MASTERID', axis = 1) | |
y = df_ml['Cu_ICP_PPM'] | |
X_train, X_test, y_train, y_test = train_test_split(X, y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import modules, data | |
import pandas as pd | |
df = pd.read_csv('litho-Table 1.csv', low_memory = False) | |
df = df[df.columns[df.isnull().mean() < 0.25]] | |
df = df.drop([col for col in df.columns if 'FA' in col or 'INA' in col or 'AAS' in col], | |
axis = 1) #drop analytes that aren't ICP-MS analysis | |
df = df[['MASTERID', 'LAT', 'LONG', | |
'STRAT'] + [col for col in df.columns if 'ICP' in col]] | |
#this program will check your data against the Canadian critical minerals list and tell you if your dataset contains any of them |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import modules --- | |
import pandas as pd | |
pd.set_option('display.max_rows', None) | |
pd.set_option('display.max_columns', None) | |
#load data ------------------------- | |
df = pd.read_csv('litho-Table 1.csv', | |
low_memory = False) | |
df_litho = pd.read_csv('geology_at_sample_site-Table 1.csv') | |
df = df.merge(df_litho, on = 'MASTERID') |