From 12f6ca02418d92153ae27435de76f95be9999106 Mon Sep 17 00:00:00 2001 From: PabloSMCK <50815736+PabloSMCK@users.noreply.github.com> Date: Thu, 25 Jul 2019 15:28:38 -0300 Subject: [PATCH 1/5] Create foo.txt --- foo.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 foo.txt diff --git a/foo.txt b/foo.txt new file mode 100644 index 00000000..f66b2046 --- /dev/null +++ b/foo.txt @@ -0,0 +1 @@ +asdwww From 8c40ee2e8147a40ea05cb1b017809834498c7910 Mon Sep 17 00:00:00 2001 From: PabloSMCK <50815736+PabloSMCK@users.noreply.github.com> Date: Thu, 25 Jul 2019 15:37:10 -0300 Subject: [PATCH 2/5] Delete foo.txt --- foo.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 foo.txt diff --git a/foo.txt b/foo.txt deleted file mode 100644 index f66b2046..00000000 --- a/foo.txt +++ /dev/null @@ -1 +0,0 @@ -asdwww From dcbf18504ba67d4c1c6dc76384423fb70a7d35dd Mon Sep 17 00:00:00 2001 From: PabloSMCK <50815736+PabloSMCK@users.noreply.github.com> Date: Thu, 25 Jul 2019 15:37:47 -0300 Subject: [PATCH 3/5] Create P.txt --- Pyhton/P.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 Pyhton/P.txt 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 @@ + From fd90f70dbe9a814f2e43731542f09632c6ce8594 Mon Sep 17 00:00:00 2001 From: PabloSMCK <50815736+PabloSMCK@users.noreply.github.com> Date: Thu, 25 Jul 2019 15:38:06 -0300 Subject: [PATCH 4/5] Create r.txt --- R/r.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 R/r.txt 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 @@ + From 0eafdc25043f730439f6ae901530e22df8c3a3f7 Mon Sep 17 00:00:00 2001 From: PabloMSC <43505422+PabloMSC@users.noreply.github.com> Date: Mon, 29 Jul 2019 04:37:09 -0300 Subject: [PATCH 5/5] pr --- Pyhton/PRE-PROCESAMIENTO.py | 26 ++++++++++++++++++++++++++ R/Pre procesamiento.R | 12 ++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Pyhton/PRE-PROCESAMIENTO.py create mode 100644 R/Pre procesamiento.R 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