{ "cells": [ { "cell_type": "markdown", "id": "d0ec1984", "metadata": {}, "source": [ "# Data Wrangling o procesos ETL" ] }, { "cell_type": "markdown", "id": "00dd2ec4", "metadata": {}, "source": [ "## Resumen" ] }, { "cell_type": "markdown", "id": "5421d959", "metadata": {}, "source": [ "En esta notebook se realiza una inspección inicial del dataset, con la idea de identificar la estructura, tipos de variables, y demás. Se identifica también, si en el conjunto de datos hay datos faltantes o registros duplicados, y se actúa en consecuencia." ] }, { "cell_type": "markdown", "id": "bcb9422f", "metadata": {}, "source": [ "## 1. Inicialización" ] }, { "cell_type": "markdown", "id": "998ec12f", "metadata": {}, "source": [ "### 1.1. Importación de librerías" ] }, { "cell_type": "code", "execution_count": 2, "id": "92dc34a9", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import os\n", "#\n", "# separador multi-OS\n", "separador=os.sep" ] }, { "cell_type": "code", "execution_count": 2, "id": "37d22656", "metadata": {}, "outputs": [], "source": [ "### 1.2. El Dataset" ] }, { "cell_type": "code", "execution_count": 3, "id": "f6db5a71", "metadata": {}, "outputs": [], "source": [ "df=pd.read_csv('datasets'+str(separador)+'iris.csv')" ] }, { "cell_type": "markdown", "id": "2beacd29", "metadata": {}, "source": [ "## 2. Descripción del Dataset" ] }, { "cell_type": "markdown", "id": "828455ff", "metadata": {}, "source": [ "### 2.1. Tamaño" ] }, { "cell_type": "code", "execution_count": 4, "id": "d8807da5", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(150, 5)" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.shape" ] }, { "cell_type": "markdown", "id": "23a7cfbf", "metadata": {}, "source": [ "### 2.2. Primeros registros" ] }, { "cell_type": "code", "execution_count": 5, "id": "91846863", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | sepal.length | \n", "sepal.width | \n", "petal.length | \n", "petal.width | \n", "variety | \n", "
---|---|---|---|---|---|
0 | \n", "5.1 | \n", "3.5 | \n", "1.4 | \n", "0.2 | \n", "Setosa | \n", "
1 | \n", "4.9 | \n", "3.0 | \n", "1.4 | \n", "0.2 | \n", "Setosa | \n", "
2 | \n", "4.7 | \n", "3.2 | \n", "1.3 | \n", "0.2 | \n", "Setosa | \n", "
3 | \n", "4.6 | \n", "3.1 | \n", "1.5 | \n", "0.2 | \n", "Setosa | \n", "
4 | \n", "5.0 | \n", "3.6 | \n", "1.4 | \n", "0.2 | \n", "Setosa | \n", "