diff --git a/Pyhton/P.txt b/Pyhton/P.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/Pyhton/P.txt @@ -0,0 +1 @@ + diff --git a/Pyhton/PRE-PROCESAMIENTO.py b/Pyhton/PRE-PROCESAMIENTO.py new file mode 100644 index 00000000..ab8dfba4 --- /dev/null +++ b/Pyhton/PRE-PROCESAMIENTO.py @@ -0,0 +1,26 @@ +""" +Created on Tue May 21 23:49:01 2019 +""" +#PLANTILLA DE PRE PROCESADO + +#IMPORTAR LAS LIBRERIAS + +import numpy as np +import matplotlib.pyplot as plt +import pandas as pd + + +#IMPORTAR EL DATASET +dataset = pd.read_csv('Data.csv') + +x = dataset.iloc[ : , :-1 ].values #MATRIZ DE DATOS INDEPENDIENTES + +y = dataset.iloc[ : , 3 ].values #VECTOR DE DATOS DEPENDIENTES + +#LIMPIEZA DE DATOS O TRATAMIENTO DE LOS NA(NULL) +from sklearn.preprocessing import Imputer +imputer = Imputer(missing_values = "NaN", strategy = "mean", axis = 0) +imputer = imputer.fit(x[:,1:3]) +x[:, 1:3] = imputer.transform(x[:, 1:3]) + +x \ No newline at end of file diff --git a/R/Pre procesamiento.R b/R/Pre procesamiento.R new file mode 100644 index 00000000..f40e933e --- /dev/null +++ b/R/Pre procesamiento.R @@ -0,0 +1,12 @@ +#PLANTILLA DE PRE PROCESADO +#IMPORTAR EL DATASET +dataset = read.csv('Data.csv') + +#LIMPIEZA DE DATOS O TRATAMIENTO DE LOS NA(NULL) +dataset$Age = ifelse (is.na(dataset$Age), + ave(dataset$Age, FUN = function(x) mean(x, na.rm = TRUE)), + dataset$Age) + +dataset$Salary = ifelse (is.na(dataset$Salary), + ave(dataset$Salary, FUN = function(x) mean(x, na.rm = TRUE)), + dataset$Salary) \ No newline at end of file diff --git a/R/r.txt b/R/r.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/R/r.txt @@ -0,0 +1 @@ +