{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"df_temp = pd.DataFrame({\"Fecha\":[\"01/01/2021\",\"01/01/2021\",\"01/01/2021\",\"02/01/2021\",\"02/01/2021\",\"02/01/2021\"],\n",
" \"Pais\":[\"España\",\"México\",\"Venezuela\",\"España\",\"México\",\"Venezuela\"],\n",
" \"Temperatura\":[20,25,28,21,None,30]})"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Fecha | \n",
" Pais | \n",
" Temperatura | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 01/01/2021 | \n",
" España | \n",
" 20.0 | \n",
"
\n",
" \n",
" 1 | \n",
" 01/01/2021 | \n",
" México | \n",
" 25.0 | \n",
"
\n",
" \n",
" 2 | \n",
" 01/01/2021 | \n",
" Venezuela | \n",
" 28.0 | \n",
"
\n",
" \n",
" 3 | \n",
" 02/01/2021 | \n",
" España | \n",
" 21.0 | \n",
"
\n",
" \n",
" 4 | \n",
" 02/01/2021 | \n",
" México | \n",
" NaN | \n",
"
\n",
" \n",
" 5 | \n",
" 02/01/2021 | \n",
" Venezuela | \n",
" 30.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Fecha Pais Temperatura\n",
"0 01/01/2021 España 20.0\n",
"1 01/01/2021 México 25.0\n",
"2 01/01/2021 Venezuela 28.0\n",
"3 02/01/2021 España 21.0\n",
"4 02/01/2021 México NaN\n",
"5 02/01/2021 Venezuela 30.0"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_temp"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Fecha | \n",
" Pais | \n",
" Temperatura | \n",
"
\n",
" \n",
" \n",
" \n",
" 1 | \n",
" 01/01/2021 | \n",
" México | \n",
" 25.0 | \n",
"
\n",
" \n",
" 2 | \n",
" 01/01/2021 | \n",
" Venezuela | \n",
" 28.0 | \n",
"
\n",
" \n",
" 5 | \n",
" 02/01/2021 | \n",
" Venezuela | \n",
" 30.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Fecha Pais Temperatura\n",
"1 01/01/2021 México 25.0\n",
"2 01/01/2021 Venezuela 28.0\n",
"5 02/01/2021 Venezuela 30.0"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_temp[df_temp[\"Temperatura\"]>22]"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Fecha | \n",
" Pais | \n",
" Temperatura | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 01/01/2021 | \n",
" España | \n",
" 20.0 | \n",
"
\n",
" \n",
" 3 | \n",
" 02/01/2021 | \n",
" España | \n",
" 21.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Fecha Pais Temperatura\n",
"0 01/01/2021 España 20.0\n",
"3 02/01/2021 España 21.0"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_temp[df_temp[\"Pais\"]==\"España\"]"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Fecha | \n",
" Pais | \n",
" Temperatura | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 01/01/2021 | \n",
" España | \n",
" 20.0 | \n",
"
\n",
" \n",
" 3 | \n",
" 02/01/2021 | \n",
" España | \n",
" 21.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Fecha Pais Temperatura\n",
"0 01/01/2021 España 20.0\n",
"3 02/01/2021 España 21.0"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_temp[df_temp[\"Pais\"].str.match(\"España\")]"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Fecha | \n",
" Pais | \n",
" Temperatura | \n",
"
\n",
" \n",
" \n",
" \n",
" 3 | \n",
" 02/01/2021 | \n",
" España | \n",
" 21.0 | \n",
"
\n",
" \n",
" 4 | \n",
" 02/01/2021 | \n",
" México | \n",
" NaN | \n",
"
\n",
" \n",
" 5 | \n",
" 02/01/2021 | \n",
" Venezuela | \n",
" 30.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Fecha Pais Temperatura\n",
"3 02/01/2021 España 21.0\n",
"4 02/01/2021 México NaN\n",
"5 02/01/2021 Venezuela 30.0"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_temp[df_temp[\"Fecha\"]==\"02/01/2021\"]"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Fecha | \n",
" Pais | \n",
" Temperatura | \n",
"
\n",
" \n",
" \n",
" \n",
" 1 | \n",
" 01/01/2021 | \n",
" México | \n",
" 25.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Fecha Pais Temperatura\n",
"1 01/01/2021 México 25.0"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_temp[(df_temp[\"Pais\"]==\"México\") & (df_temp[\"Temperatura\"].notnull())]"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"RangeIndex: 6 entries, 0 to 5\n",
"Data columns (total 3 columns):\n",
"Fecha 6 non-null object\n",
"Pais 6 non-null object\n",
"Temperatura 5 non-null float64\n",
"dtypes: float64(1), object(2)\n",
"memory usage: 272.0+ bytes\n"
]
}
],
"source": [
"df_temp.info()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Ejercicio"
]
},
{
"cell_type": "code",
"execution_count": 39,
"metadata": {},
"outputs": [],
"source": [
"df = pd.read_csv(r'C:\\Users\\ivan_pinar\\Dropbox\\Creación de MOCs\\MOC Master Python Análisis de Datos\\Datasets\\5.8\\PEATONES_2020_mod.csv', encoding = \"ISO-8859-1\",delimiter=\";\",index_col=2)"
]
},
{
"cell_type": "code",
"execution_count": 40,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" FECHA | \n",
" HORA | \n",
" PEATONES | \n",
" NÚMERO_DISTRITO | \n",
" DISTRITO | \n",
" NOMBRE_VIAL | \n",
" NÚMERO | \n",
" CÓDIGO_POSTAL | \n",
" OBSERVACIONES_DIRECCION | \n",
" LATITUD | \n",
" LONGITUD | \n",
"
\n",
" \n",
" IDENTIFICADOR | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:00:00 | \n",
" 497.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:15:00 | \n",
" 244.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:30:00 | \n",
" 179.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:45:00 | \n",
" 174.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:00:00 | \n",
" 131.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:15:00 | \n",
" 95.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:30:00 | \n",
" NaN | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:45:00 | \n",
" 175.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 2:00:00 | \n",
" 149.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 2:15:00 | \n",
" 126.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,0 | \n",
" 0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" FECHA HORA PEATONES NÚMERO_DISTRITO DISTRITO \\\n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 01/01/2020 0:00:00 497.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:15:00 244.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:30:00 179.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:45:00 174.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:00:00 131.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:15:00 95.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:30:00 NaN 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:45:00 175.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 2:00:00 149.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 2:15:00 126.0 1.0 Centro \n",
"\n",
" NOMBRE_VIAL NÚMERO CÓDIGO_POSTAL \\\n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"\n",
" OBSERVACIONES_DIRECCION LATITUD LONGITUD \n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,0 0 "
]
},
"execution_count": 40,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.head(10)"
]
},
{
"cell_type": "code",
"execution_count": 41,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(288755, 11)"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.shape"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [],
"source": [
"df2 = df[(df[\"FECHA\"]>=\"01/01/2020\") & (df[\"FECHA\"]<=\"01/05/2020\")]"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" FECHA | \n",
" HORA | \n",
" PEATONES | \n",
" NÚMERO_DISTRITO | \n",
" DISTRITO | \n",
" NOMBRE_VIAL | \n",
" NÚMERO | \n",
" CÓDIGO_POSTAL | \n",
" OBSERVACIONES_DIRECCION | \n",
" LATITUD | \n",
" LONGITUD | \n",
"
\n",
" \n",
" IDENTIFICADOR | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:00:00 | \n",
" 497.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:15:00 | \n",
" 244.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:30:00 | \n",
" 179.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:45:00 | \n",
" 174.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:00:00 | \n",
" 131.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 22:45:00 | \n",
" 568.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 23:00:00 | \n",
" 588.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 23:15:00 | \n",
" 504.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 23:30:00 | \n",
" 554.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 23:45:00 | \n",
" 492.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
"
\n",
"
7481 rows × 11 columns
\n",
"
"
],
"text/plain": [
" FECHA HORA PEATONES NÚMERO_DISTRITO DISTRITO \\\n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 01/01/2020 0:00:00 497.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:15:00 244.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:30:00 179.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:45:00 174.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:00:00 131.0 1.0 Centro \n",
"... ... ... ... ... ... \n",
"PERM_PEA19_PM01 01/05/2020 22:45:00 568.0 1.0 Centro \n",
"PERM_PEA19_PM01 01/05/2020 23:00:00 588.0 1.0 Centro \n",
"PERM_PEA19_PM01 01/05/2020 23:15:00 504.0 1.0 Centro \n",
"PERM_PEA19_PM01 01/05/2020 23:30:00 554.0 1.0 Centro \n",
"PERM_PEA19_PM01 01/05/2020 23:45:00 492.0 1.0 Centro \n",
"\n",
" NOMBRE_VIAL NÚMERO CÓDIGO_POSTAL \\\n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"... ... ... ... \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"\n",
" OBSERVACIONES_DIRECCION LATITUD LONGITUD \n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"... ... ... ... \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"\n",
"[7481 rows x 11 columns]"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df2"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"outputs": [],
"source": [
"df2 = df2[df2[\"DISTRITO\"].str.contains(\"Centro\")]"
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" FECHA | \n",
" HORA | \n",
" PEATONES | \n",
" NÚMERO_DISTRITO | \n",
" DISTRITO | \n",
" NOMBRE_VIAL | \n",
" NÚMERO | \n",
" CÓDIGO_POSTAL | \n",
" OBSERVACIONES_DIRECCION | \n",
" LATITUD | \n",
" LONGITUD | \n",
"
\n",
" \n",
" IDENTIFICADOR | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:00:00 | \n",
" 497.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:15:00 | \n",
" 244.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:30:00 | \n",
" 179.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:45:00 | \n",
" 174.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:00:00 | \n",
" 131.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 22:45:00 | \n",
" 568.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 23:00:00 | \n",
" 588.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 23:15:00 | \n",
" 504.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 23:30:00 | \n",
" 554.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 23:45:00 | \n",
" 492.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
"
\n",
"
5178 rows × 11 columns
\n",
"
"
],
"text/plain": [
" FECHA HORA PEATONES NÚMERO_DISTRITO DISTRITO \\\n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 01/01/2020 0:00:00 497.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:15:00 244.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:30:00 179.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:45:00 174.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:00:00 131.0 1.0 Centro \n",
"... ... ... ... ... ... \n",
"PERM_PEA19_PM01 01/05/2020 22:45:00 568.0 1.0 Centro \n",
"PERM_PEA19_PM01 01/05/2020 23:00:00 588.0 1.0 Centro \n",
"PERM_PEA19_PM01 01/05/2020 23:15:00 504.0 1.0 Centro \n",
"PERM_PEA19_PM01 01/05/2020 23:30:00 554.0 1.0 Centro \n",
"PERM_PEA19_PM01 01/05/2020 23:45:00 492.0 1.0 Centro \n",
"\n",
" NOMBRE_VIAL NÚMERO CÓDIGO_POSTAL \\\n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"... ... ... ... \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"\n",
" OBSERVACIONES_DIRECCION LATITUD LONGITUD \n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"... ... ... ... \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"\n",
"[5178 rows x 11 columns]"
]
},
"execution_count": 45,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df2"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [],
"source": [
"df2 = df[(df[\"FECHA\"]>=\"01/01/2020\") & (df[\"FECHA\"]<=\"01/05/2020\") & (df[\"DISTRITO\"].str.contains(\"Centro\"))]"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" FECHA | \n",
" HORA | \n",
" PEATONES | \n",
" NÚMERO_DISTRITO | \n",
" DISTRITO | \n",
" NOMBRE_VIAL | \n",
" NÚMERO | \n",
" CÓDIGO_POSTAL | \n",
" OBSERVACIONES_DIRECCION | \n",
" LATITUD | \n",
" LONGITUD | \n",
"
\n",
" \n",
" IDENTIFICADOR | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:00:00 | \n",
" 497.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:15:00 | \n",
" 244.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:30:00 | \n",
" 179.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:45:00 | \n",
" 174.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:00:00 | \n",
" 131.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 22:45:00 | \n",
" 568.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 23:00:00 | \n",
" 588.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 23:15:00 | \n",
" 504.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 23:30:00 | \n",
" 554.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
" PERM_PEA19_PM01 | \n",
" 01/05/2020 | \n",
" 23:45:00 | \n",
" 492.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Bailén | \n",
" 6.0 | \n",
" 28013.0 | \n",
" Acera Pares Datos en prueba | \n",
" 40,417278 | \n",
" -3,713371 | \n",
"
\n",
" \n",
"
\n",
"
5178 rows × 11 columns
\n",
"
"
],
"text/plain": [
" FECHA HORA PEATONES NÚMERO_DISTRITO DISTRITO \\\n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 01/01/2020 0:00:00 497.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:15:00 244.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:30:00 179.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:45:00 174.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:00:00 131.0 1.0 Centro \n",
"... ... ... ... ... ... \n",
"PERM_PEA19_PM01 01/05/2020 22:45:00 568.0 1.0 Centro \n",
"PERM_PEA19_PM01 01/05/2020 23:00:00 588.0 1.0 Centro \n",
"PERM_PEA19_PM01 01/05/2020 23:15:00 504.0 1.0 Centro \n",
"PERM_PEA19_PM01 01/05/2020 23:30:00 554.0 1.0 Centro \n",
"PERM_PEA19_PM01 01/05/2020 23:45:00 492.0 1.0 Centro \n",
"\n",
" NOMBRE_VIAL NÚMERO CÓDIGO_POSTAL \\\n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"... ... ... ... \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"PERM_PEA19_PM01 Calle Bailén 6.0 28013.0 \n",
"\n",
" OBSERVACIONES_DIRECCION LATITUD LONGITUD \n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"... ... ... ... \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"PERM_PEA19_PM01 Acera Pares Datos en prueba 40,417278 -3,713371 \n",
"\n",
"[5178 rows x 11 columns]"
]
},
"execution_count": 48,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df2"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"FECHA 5178\n",
"HORA 5178\n",
"PEATONES 5176\n",
"NÚMERO_DISTRITO 5178\n",
"DISTRITO 5178\n",
"NOMBRE_VIAL 5178\n",
"NÚMERO 5178\n",
"CÓDIGO_POSTAL 5178\n",
"OBSERVACIONES_DIRECCION 5178\n",
"LATITUD 5178\n",
"LONGITUD 5178\n",
"dtype: int64"
]
},
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df2.count()"
]
},
{
"cell_type": "code",
"execution_count": 50,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" FECHA | \n",
" HORA | \n",
" PEATONES | \n",
" NÚMERO_DISTRITO | \n",
" DISTRITO | \n",
" NOMBRE_VIAL | \n",
" NÚMERO | \n",
" CÓDIGO_POSTAL | \n",
" OBSERVACIONES_DIRECCION | \n",
" LATITUD | \n",
" LONGITUD | \n",
"
\n",
" \n",
" IDENTIFICADOR | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:00:00 | \n",
" 497.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:15:00 | \n",
" 244.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:30:00 | \n",
" 179.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:45:00 | \n",
" 174.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:00:00 | \n",
" 131.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:15:00 | \n",
" 95.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:30:00 | \n",
" NaN | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:45:00 | \n",
" 175.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 2:00:00 | \n",
" 149.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 2:15:00 | \n",
" 126.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,0 | \n",
" 0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" FECHA HORA PEATONES NÚMERO_DISTRITO DISTRITO \\\n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 01/01/2020 0:00:00 497.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:15:00 244.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:30:00 179.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:45:00 174.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:00:00 131.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:15:00 95.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:30:00 NaN 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:45:00 175.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 2:00:00 149.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 2:15:00 126.0 1.0 Centro \n",
"\n",
" NOMBRE_VIAL NÚMERO CÓDIGO_POSTAL \\\n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"\n",
" OBSERVACIONES_DIRECCION LATITUD LONGITUD \n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,0 0 "
]
},
"execution_count": 50,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df2.head(10)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 51,
"metadata": {},
"outputs": [],
"source": [
"df_interp = df2.interpolate(method ='linear', limit_direction ='forward')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 52,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"FECHA 5178\n",
"HORA 5178\n",
"PEATONES 5178\n",
"NÚMERO_DISTRITO 5178\n",
"DISTRITO 5178\n",
"NOMBRE_VIAL 5178\n",
"NÚMERO 5178\n",
"CÓDIGO_POSTAL 5178\n",
"OBSERVACIONES_DIRECCION 5178\n",
"LATITUD 5178\n",
"LONGITUD 5178\n",
"dtype: int64"
]
},
"execution_count": 52,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_interp.count()"
]
},
{
"cell_type": "code",
"execution_count": 53,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" FECHA | \n",
" HORA | \n",
" PEATONES | \n",
" NÚMERO_DISTRITO | \n",
" DISTRITO | \n",
" NOMBRE_VIAL | \n",
" NÚMERO | \n",
" CÓDIGO_POSTAL | \n",
" OBSERVACIONES_DIRECCION | \n",
" LATITUD | \n",
" LONGITUD | \n",
"
\n",
" \n",
" IDENTIFICADOR | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:00:00 | \n",
" 497.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:15:00 | \n",
" 244.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:30:00 | \n",
" 179.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 0:45:00 | \n",
" 174.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:00:00 | \n",
" 131.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:15:00 | \n",
" 95.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:30:00 | \n",
" 135.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 1:45:00 | \n",
" 175.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 2:00:00 | \n",
" 149.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,4220090 | \n",
" -3,7008917 | \n",
"
\n",
" \n",
" PERM_PEA02_PM01 | \n",
" 01/01/2020 | \n",
" 2:15:00 | \n",
" 126.0 | \n",
" 1.0 | \n",
" Centro | \n",
" Calle Fuencarral | \n",
" 22.0 | \n",
" 28004.0 | \n",
" Calle peatonal Datos en prueba | \n",
" 40,0 | \n",
" 0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" FECHA HORA PEATONES NÚMERO_DISTRITO DISTRITO \\\n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 01/01/2020 0:00:00 497.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:15:00 244.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:30:00 179.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 0:45:00 174.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:00:00 131.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:15:00 95.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:30:00 135.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 1:45:00 175.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 2:00:00 149.0 1.0 Centro \n",
"PERM_PEA02_PM01 01/01/2020 2:15:00 126.0 1.0 Centro \n",
"\n",
" NOMBRE_VIAL NÚMERO CÓDIGO_POSTAL \\\n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"PERM_PEA02_PM01 Calle Fuencarral 22.0 28004.0 \n",
"\n",
" OBSERVACIONES_DIRECCION LATITUD LONGITUD \n",
"IDENTIFICADOR \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,4220090 -3,7008917 \n",
"PERM_PEA02_PM01 Calle peatonal Datos en prueba 40,0 0 "
]
},
"execution_count": 53,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_interp.head(10)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}