EmployPeru / app.py
C2MV's picture
Update app.py
e579437 verified
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.dates as mdates
from datetime import datetime
import seaborn as sns
import gradio as gr
from matplotlib.figure import Figure
cities_data = {
'Abancay': {
'desempleo_trimestral': [
["2022-Q1", 6.7, 6.8, 6.6],
["2022-Q2", 3.7, None, None], # Dato de referencia
["2022-Q3", 2.3, 2.1, 2.6], # Dato de referencia
["2022-Q4", 2.8, 2.6, 3.1], # Dato de referencia
["2023-Q1", 6.0, 6.1, 5.9],
["2023-Q2", 4.9, 4.0, 6.0],
["2023-Q3", 5.8, 5.3, 6.5],
["2023-Q4", 4.5, 3.3, 5.9],
["2024-Q1", 7.2, 5.9, 8.8],
["2024-Q2", 8.1, 8.4, 7.8],
["2024-Q3", 6.7, 5.1, 8.5],
["2024-Q4", 6.1, 5.4, 6.8],
],
'ingresos_periodo': [
["2022-04/2023-03", 1913.0, 2212.5, 1548.0],
["2022-07/2023-06", 1898.4, 2203.9, 1523.8],
["2022-10/2023-09", 1903.2, 2179.2, 1564.3],
["2023-04/2024-03", 1949.7, 2224.0, 1609.3],
["2023-07/2024-06", 1999.4, 2276.3, 1658.1],
["2023-10/2024-09", 2044.2, 2341.5, 1679.2],
["2024", 2006.5, 2274.6, 1677.6],
],
'informal_periodo': [
["2022-04/2023-03", 68.2, 71.8, 65.1],
["2023", 66.8, 68.4, 65.5],
["2023-04/2024-03", None, None, None],
["2023-07/2024-06", None, None, None],
["2023-10/2024-09", None, None, None],
["2024", None, None, None],
],
'actividad_trimestral': [
["2023-Q3", 73.1, 79.7, 66.4],
["2024-Q3", 71.9, 76.7, 67.1],
],
'poblacion_ocupada': [
["2022-Q1", 42.5, 23.2, 19.3],
["2022-Q2", 43.1, 22.9, 20.1],
["2022-Q3", 47.6, 25.4, 22.2],
["2023-Q1", 43.6, 23.7, 20.0],
["2023-Q2", 44.1, 24.0, 20.2],
["2023-Q3", 46.6, 25.6, 21.1],
["2024-Q1", 43.4, 24.5, 18.8],
["2024-Q2", 45.5, 24.6, 20.9],
["2024-Q3", 46.5, 25.2, 21.3],
]
},
'Arequipa': {
'desempleo_trimestral': [
["2022-Q1", 9.3, 8.0, 10.2],
["2022-Q2", 4.6, None, None],
["2022-Q3", 5.0, None, None],
["2022-Q4", 4.7, None, None],
["2023-Q1", 9.0, 8.0, 10.2],
["2023-Q2", 7.1, 6.4, 8.1],
["2023-Q3", 7.9, 6.1, 10.0],
["2023-Q4", 7.1, 6.2, 8.2],
["2024-Q1", 10.1, 8.9, 11.5],
["2024-Q2", 7.9, 7.4, 8.5],
["2024-Q3", 8.0, 6.2, 10.2],
["2024-Q4", 6.3, 5.4, 7.4],
],
'ingresos_periodo': [
["2022-04/2023-03", 2136.2, 2538.1, 1638.5],
["2022-07/2023-06", 2165.4, 2582.9, 1642.8],
["2023-04/2024-03", 2221.4, 2570.1, 1765.6],
["2023-07/2024-06", 2277.5, 2634.4, 1810.4],
["2023-10/2024-09", 2322.4, 2708.2, 1813.3],
["2024", 2298.6, 2698.8, 1773.9]
],
'informal_periodo': [
["2022-04/2023-03", 59.0, 57.3, 61.2],
["2022-07/2023-06", 58.3, 56.0, 61.1],
["2023", 56.0, 53.4, 59.2],
["2023-04/2024-03", 55.6, 53.2, 58.7],
["2023-07/2024-06", 55.1, 52.9, 57.9],
["2023-10/2024-09", 54.9, 52.7, 57.8],
["2024", None, None, None]
],
'actividad_trimestral': [
["2023-Q1",58.3,None, None],
["2023-Q2",58.7,None, None],
["2023-Q3",58.0,None, None],
["2024-Q1",56.3,None, None],
["2024-Q2",58.6,None, None],
["2024-Q3",58.8,None, None],
["2024-Q4",57.9,None, None],
],
'poblacion_ocupada': [
["2022-Q1", 510.8, 273.5, 237.3],
["2023-Q1", 479.3, 266.6, 212.8],
]
},
'Ayacucho': {
'desempleo_trimestral': [
["2022-Q1", 8.6, None, None],
["2022-Q2", 5.5, None, None],
["2022-Q3", 3.6, None, None],
["2022-Q4", 5.1, None, None],
["2023-Q1", 9.3, 7.1, 11.8],
["2023-Q2", 7.4, 7.6, 7.2],
["2023-Q3", 7.0, 5.1, 9.1],
["2023-Q4", 4.7, 3.9, 5.6],
["2024-Q1", 6.5, 6.0, 7.0],
["2024-Q2", 9.0, 9.1, 8.9],
["2024-Q3", 5.4, 4.3, 6.7],
["2024-Q4", 5.7, 4.3, 7.3],
],
'ingresos_periodo': [
["2022-04/2023-03", 1565.1, 1778.2, 1297.6],
["2022-07/2023-06", 1591.9, 1816.0, 1315.6],
["2022-10/2023-09", 1605.3, 1850.7, 1306.1],
["2023-04/2024-03", 1670.0, 1932.4, 1351.8],
["2023-07/2024-06", 1715.0, 1977.5, 1399.3],
["2023-10/2024-09", 1750.7, 2008.7, 1439.4],
["2024", 1764.4, 2003.6, 1472.2]
],
'informal_periodo': [
["2023-04/2024-03", 59.6, 56.0, 64.0],
["2023-07/2024-06", 58.7, 55.3, 63.3],
["2023-10/2024-09", 59.5, 56.1, 64.0],
],
'actividad_trimestral': [
["2023-Q1", 68.3, None, None],
["2023-Q3", 72.0, None, None],
["2024-Q1", 70.3, None, None],
["2024-Q3", 70.9, None, None],
],
'poblacion_ocupada': [
["2022-Q1", 117.5, 64.3, 53.2],
["2022-Q2", 114.8, 63.3, 51.5],
["2022-Q3", 124.6, 68.3, 56.3],
["2023-Q1", 113.3, 62.9, 50.4],
["2023-Q2", 121.6, 63.5, 58.1],
["2023-Q3", 124.1, 66.9, 57.3],
["2023-Q4", 122.1, 65.8, 56.3],
["2024-Q1", 123.6, 67.4, 56.1],
["2024-Q2", 126.4, 66.9, 59.5],
["2024-Q3", 127.6, 69.0, 58.6],
["2024-Q4", 126.0, 68.8, 57.1],
]
},
'Cajamarca': {
'desempleo_trimestral': [
["2022-Q1", 9.0, 7.2, 13.5],
["2022-Q2", 6.5, 6.5, 11.9],
["2022-Q3", 5.2, 7.2, 11.4],
["2022-Q4", 4.7, 4.9, 4.5],
["2023-Q1", 10.1, 7.2, 13.5],
["2023-Q2", 11.2, 10.6, 11.9],
["2023-Q3", 9.2, 7.2, 11.4],
["2023-Q4", 8.6, 7.4, 10.0],
["2024-Q1", 12.9, 11.8, 14.2],
["2024-Q2", 10.5, 10.1, 11.0],
["2024-Q3", 11.0, 10.7, 11.3],
["2024-Q4", 11.1, 10.8, 11.4],
],
'ingresos_periodo': [
["2022-04/2023-03", 1755.8, 2105.8, 1338.6],
["2022-07/2023-06", 1818.8, 2182.5, 1386.0],
["2022-10/2023-09", 1866.9, 2226.1, 1440.6],
["2023", 1922.4, 2294.7, 1475.5],
["2023-04/2024-03", 1958.2, 2343.5, 1490.0],
["2023-07/2024-06", 1936.7, 2295.6, 1503.6],
["2023-10/2024-09", 1942.5, 2318.6, 1493.6],
["2024", 1972.0, 2352.5, 1519.1],
],
'informal_periodo': [
# No hay datos num茅ricos espec铆ficos, solo menciones gr谩ficas.
],
'actividad_trimestral': [
["2024-Q1", 65.5, None, None],
["2024-Q2", 65.9, None, None],
["2024-Q3", 67.2, None, None],
],
'poblacion_ocupada': [
["2022-Q1", 111.4, 61.4, 50.0],
["2022-Q2", 111.3, 60.8, 50.5],
["2022-Q3", 114.2, 61.1, 53.1],
["2023-Q1", 110.1, 60.2, 49.8],
["2023-Q2", 108.1, 57.0, 51.0],
["2023-Q3", 109.7, 58.7, 51.0],
["2024-Q1", 108.5, 60.2, 48.4],
["2024-Q2", 112.7, 60.3, 52.5],
["2024-Q3", 114.9, 60.0, 54.9],
]
},
'Chachapoyas': {
'desempleo_trimestral': [
["2022-Q1", 7.2, 6.5, 10.8],
["2022-Q2", 2.9, 4.6, 6.1],
["2022-Q3", 2.6, 4.4, 7.3],
["2022-Q4", 3.3, 5.0, 4.4],
["2023-Q1", 8.5, 6.5, 10.8],
["2023-Q2", 5.3, 4.6, 6.1],
["2023-Q3", 5.8, 4.4, 7.3],
["2023-Q4", 4.7, 5.0, 4.4],
["2024-Q1", 7.8, 6.8, 8.9],
["2024-Q2", 7.0, 6.2, 7.9],
["2024-Q3", 5.6, 4.6, 6.7],
["2024-Q4", 4.6, 5.1, 4.1],
],
'ingresos_periodo': [
["2022-04/2023-03", 2100.8, 2414.0, 1738.8],
["2022-07/2023-06", 2125.8, 2456.4, 1744.5],
["2022-10/2023-09", 2180.9, 2518.0, 1784.0],
["2023", 2228.7, 2556.6, 1840.6],
["2023-04/2024-03", 2306.8, 2670.7, 1885.7],
["2023-07/2024-06", 2339.6, 2702.3, 1920.5],
["2023-10/2024-09", 2338.2, 2725.6, 1894.0],
["2024", 2323.5, 2744.6, 1847.9],
],
'informal_periodo': [
# No hay datos num茅ricos espec铆ficos, solo inferencias de gr谩ficos.
],
'actividad_trimestral': [
["2023-Q1", 68.2, None, None],
["2023-Q3", 67.8, None, None],
["2024-Q1", 67.7, None, None],
["2024-Q2", 67.1, None, None],
["2024-Q3", 66.5, None, None],
],
'poblacion_ocupada': [
["2022-Q2", 19.6, 10.3, 9.2],
["2022-Q3", 20.5, 10.6, 9.8],
["2023-Q2", 19.4, 10.3, 9.1],
["2023-Q3", 19.3, 10.4, 8.9],
["2024-Q2", 19.2, 10.2, 9.0],
["2024-Q3", 19.5, 10.2, 9.2],
]
},
'Chiclayo': {
'desempleo_trimestral': [
["2022-Q2", 5.0, None, 6.2],
["2022-Q3", 4.8, 7.0, 10.0],
["2022-Q4", 5.2, None, None],
["2023-Q1", 9.1, 7.1, 11.5],
["2023-Q2", 8.1, 6.2, 10.2],
["2023-Q3", 8.4, 7.0, 10.0],
["2023-Q4", 7.7, 6.7, 9.0],
["2024-Q1", 9.8, 7.7, 12.3],
["2024-Q2", 9.8, 9.7, 9.8],
["2024-Q3", 9.9, 8.5, 11.6],
["2024-Q4", 5.7, 5.1, 6.3],
],
'ingresos_periodo': [
["2023-04/2024-03", 1704.2, 1883.2, 1486.1],
["2023-07/2024-06", 1653.4, 1837.1, 1432.8],
["2023-10/2024-09", 1632.2, 1811.6, 1414.9],
["2024", 1636.7, 1832.9, 1400.3],
["2022-04/2023-03",1648.7,1905.1,1413.6],
["2022-10/2023-09",1718.2,1930.5,1457.5],
["2023",1714.7,1893.8,1493.9]
],
'informal_periodo': [
# No hay datos num茅ricos espec铆ficos, solo inferencias de gr谩ficos.
],
'actividad_trimestral': [
["2023-Q1", 63.8, None, None],
["2023-Q3", 63.6, None, None],
["2024-Q1", 64.6, None, None],
["2024-Q3", 65.2, None, None],
],
'poblacion_ocupada': [
["2022-Q1", 298.4, 158.8, 139.6],
["2022-Q2", 272.0, 148.0, 124.0],
["2022-Q3", 298.4, 158.8, 139.6],
["2023-Q1", 274.5, 152.5, 122.0],
["2023-Q2", 272.0, 148.0, 124.0],
["2023-Q3", 276.7, 148.3, 128.4],
["2024-Q1", 277.3, 152.8, 124.5],
["2024-Q2", 276.6, 148.0, 128.5],
["2024-Q3", 280.4, 151.4, 129.0],
]
},
'Chimbote': {
'desempleo_trimestral': [
["2023-Q1", 7.4, 5.8, 9.3],
["2023-Q2", 5.7, 4.3, 7.3],
["2023-Q3", 7.7, 6.5, 9.1],
["2023-Q4", 8.1, 7.6, 8.8],
["2024-Q1", 7.9, 6.7, 9.3],
["2024-Q2", 7.1, 6.0, 8.4],
["2024-Q3", 7.1, 5.6, 8.9],
["2024-Q4", 6.7, 6.1, 7.4],
],
'ingresos_periodo': [
["2022-04/2023-03", 1723.4, 2033.5, 1322.7],
["2023", 1795.0, 2126.4, 1375.1],
["2023-04/2024-03", 1856.7, 2226.1, 1391.3],
["2023-07/2024-06", 1863.5, 2198.6, 1432.0],
["2023-10/2024-09", 1897.0, 2251.0, 1438.0],
["2024", 1927.5, 2236.3, 1528.9],
["2022-07/2023-06",1737.3,2049.7,1343.4],
["2022-10/2023-09",1763.2,2079.7,1362.5]
],
'informal_periodo': [
["2023-07/2024-06", 68.7, 67.6, 70.2],
],
'actividad_trimestral': [
["2023-Q3", 63.5, None, None],
["2024-Q1", 66.5, None, None],
["2024-Q3", 61.9, None, None],
],
'poblacion_ocupada': [
["2023-Q1", 184.9, 104.0, 80.9],
["2023-Q2", 180.0, 101.6, 78.3],
["2023-Q3", 186.4, 105.6, 80.8],
["2024-Q1", 191.9, 106.9, 85.1],
["2024-Q2", 187.7, 105.2, 82.4],
["2024-Q3", 181.2, 102.7, 78.5],
]
},
'Cusco': {
'desempleo_trimestral': [
["2022-Q1", 7.5, 7.5, 7.5],
["2022-Q2", 4.1, None, None],
["2022-Q3", 3.6, None, None],
["2022-Q4", 4.2, None, None],
["2023-Q1", 12.3, 11.5, 13.1],
["2023-Q2", 8.3, 8.3, 8.4],
["2023-Q3", 6.6, 4.7, 8.7],
["2023-Q4", 6.2, 4.8, 7.8],
["2024-Q1", 12.5, 10.3, 14.9],
["2024-Q2", 8.1, 8.4, 7.8],
["2024-Q3", 6.3, 4.3, 8.3],
["2024-Q4", 6.9, 6.6, 7.1],
],
'ingresos_periodo': [
["2022-04/2023-03", 1876.3, 2137.7, 1572.0],
["2023", 1960.0, 2159.4, 1724.4],
["2023-04/2024-03", 2003.4, 2226.7, 1745.8],
["2023-07/2024-06", 2009.0, 2240.7, 1748.2],
["2023-10/2024-09", 2041.7, 2275.8, 1778.8],
["2024", 2078.0, 2321.0, 1806.7],
###
["2022-07/2023-06", 1913.9, 2147.3, 1639.0],
["2022-10/2023-09", 1932.6, 2152.5, 1676.4],
],
'informal_periodo': [
["2023", 61.5, 54.0, 71.7], # Dato del a帽o 2023
["2022-04/2023-03",None,None,None],
["2022-07/2023-06",None,None,None],
["2022-10/2023-09",None,None,None],
["2023-04/2024-03",None,None,None],
["2023-07/2024-06",None,None,None],
["2023-10/2024-09",None,None,None],
["2024",None,None,None]
],
'actividad_trimestral': [
["2023-Q1", 62.4, None, None],
["2023-Q3", 68.2, None, None],
["2024-Q1", 69.3, None, None],
["2024-Q3", 68.7, None, None],
],
'poblacion_ocupada': [
["2022-Q1", 231.9, 123.8, 108.1],
["2022-Q2", 239.3, 125.1, 114.2],
["2022-Q3", 238.5, 127.3, 111.2],
["2023-Q1", 205.0, 111.4, 93.6],
["2023-Q2", 229.1, 123.6, 105.4],
["2023-Q3", 240.1, 128.4, 111.8],
["2024-Q1", 230.3, 121.9, 108.4],
["2024-Q2", 239.3, 123.9, 115.4],
["2024-Q3", 246.0, 129.2, 116.8],
]
},
'Huancavelica': {
'desempleo_trimestral': [
["2022-Q1", 10.5, 13.5, 17.1],
["2022-Q2", 5.8, None, None],
["2022-Q3", 4.6, None, None],
["2022-Q4", 5.4, 5.2, 5.7],
["2023-Q1", 15.2, 13.5, 17.1],
["2023-Q2", 10.7, 12.3, 8.9],
["2023-Q3", 8.2, 8.9, 7.5],
["2023-Q4", 9.1, 8.9, 9.2],
["2024-Q1", 14.5, 15.1, 13.8],
["2024-Q2", 13.4, 13.1, 13.6],
["2024-Q3", 11.5, 12.1, 10.8],
["2024-Q4", 8.7, 9.3, 8.0],
],
'ingresos_periodo': [
["2022-04/2023-03", 1638.8, 1819.8, 1420.1],
["2022-07/2023-06", 1676.8, 1876.2, 1440.6],
["2022-10/2023-09", 1660.6, 1856.6, 1432.5],
["2023", 1732.1, 1954.8, 1478.8],
["2023-04/2024-03", 1776.9, 2011.0, 1509.6],
["2023-07/2024-06", 1815.6, 2050.0, 1543.0],
["2023-10/2024-09", 1861.6, 2096.7, 1590.1],
["2024", 1864.4, 2096.0, 1595.9],
],
'informal_periodo': [
["2023", 61.0, 59.5, 62.6],
],
'actividad_trimestral': [
["2022-Q3",68.9,None,None],
["2023-Q2",66.9,None,None],
["2023-Q3",68.9,None,None],
["2024-Q1",66.3,None,None],
["2024-Q2",68.7,None,None],
["2024-Q3",71.3,None,None]
],
'poblacion_ocupada': [
["2022-Q1", 26.1, 14.4, 11.7],
["2022-Q2", 40.7, 23.2, 17.5],
["2022-Q3", 27.4, 14.5, 12.8],
["2023-Q1", 23.4, 12.8, 10.7],
["2023-Q2", 26.3, 13.4, 12.9],
["2023-Q3", 28.0, 14.7, 13.3],
["2024-Q1", 26.8, 14.1, 12.6],
["2024-Q2", 26.8, 14.1, 12.6],
["2024-Q3", 28.5, 14.9, 13.6],
]
},
'Huancayo': {
'desempleo_trimestral': [
["2022-Q1", 7.4, 7.7, 13.5],
["2022-Q2", 3.9, 7.5, 8.4],
["2022-Q3", 3.5, 5.2, 6.6],
["2022-Q4", 4.1, None, None],
["2023-Q1", 10.5, 10.3, 10.1],
["2023-Q2", 7.9, 7.5, 8.4],
["2023-Q3", 5.9, 5.2, 6.6],
["2023-Q4", 7.4, 6.5, 8.4],
["2024-Q1", 10.2, 10.3, 10.1],
["2024-Q2", 8.4, 7.2, 9.6],
["2024-Q3", 7.2, 9.0, 5.4],
["2024-Q4", 6.7, 5.5, 8.1],
],
'ingresos_periodo': [
["2022-04/2023-03", 1665.5, 1927.0, 1367.5],
["2022-07/2023-06", 1702.3, 1978.8, 1387.9],
["2022-10/2023-09", 1705.7, 1992.6, 1382.4],
["2023", 1715.8, 2007.6, 1388.0],
["2023-04/2024-03", 1707.7, 2003.1, 1383.4],
["2023-07/2024-06", 1705.3, 2014.3, 1364.7],
["2023-10/2024-09", 1724.5, 2029.0, 1395.4],
["2024", 1754.2, 2061.6, 1410.3],
],
'informal_periodo': [
["2023", 66.6, 63.9, 69.6],
],
'actividad_trimestral': [
["2022-Q3", 67.0, None, None],
["2023-Q1", 66.4, None, None],
["2023-Q3", 67.0, None, None],
["2024-Q1", 65.4, None, None],
["2024-Q3", 62.9, None, None],
],
'poblacion_ocupada': [
["2022-Q1", 253.5, 128.0, 125.5],
["2022-Q2", 255.8, 130.2, 125.6],
["2022-Q3", 266.1, 142.2, 123.9],
["2023-Q1", 251.9, 134.2, 117.6],
["2023-Q2", 252.1, 129.4, 122.7],
["2023-Q3", 268.9, 142.4, 126.5],
["2023-Q4", 259.4, None, None],
["2024-Q1", 252.2, 130.1, 122.1],
["2024-Q2", 254.7, 130.2, 124.4],
["2024-Q3", 252.4, 129.0, 123.5],
["2024-Q4", 257.3, 139.5, 117.8]
]
},
'Hu谩nuco': {
'desempleo_trimestral': [
["2022-Q1", 10.2, 8.3, 12.2],
["2022-Q2", 3.9, 6.5, 10.7],
["2022-Q3", 3.8, 4.4, 7.5],
["2022-Q4", 4.2, None, None],
["2023-Q1", 10.0, 8.3, 12.2],
["2023-Q2", 8.5, 6.5, 10.7],
["2023-Q3", 5.8, 4.4, 7.5],
["2023-Q4", 6.8, 6.9, 6.6],
["2024-Q1", 10.1, 8.4, 12.5],
["2024-Q2", 7.0, 7.1, 7.0],
["2024-Q3", 8.7, 7.2, 10.4],
["2024-Q4", 4.1, 1.7, 7.2],
],
'ingresos_periodo': [
["2022-04/2023-03", 1733.4, 1966.6, 1415.4],
["2022-07/2023-06", 1796.7, 2027.4, 1492.1],
["2022-10/2023-09", 1864.3, 2065.9, 1592.7],
["2023", 1919.4, 2115.1, 1657.2],
["2023-04/2024-03", 1931.0, 2119.8, 1677.8],
["2023-07/2024-06", 1958.5, 2132.6, 1722.6],
["2023-10/2024-09", 1963.3, 2122.9, 1747.3],
["2024", 1957.5, 2095.7, 1766.8],
],
'informal_periodo': [
# No hay datos num茅ricos espec铆ficos, solo inferencias de gr谩ficos.
],
'actividad_trimestral': [
["2023-Q3", 66.3, None, None],
["2024-Q1", 65.3, None, None],
["2024-Q3", 62.3, None, None],
],
'poblacion_ocupada': [
["2024-Q2", 64.0, 35.0, 29.0],
["2024-Q3", 64.0, 35.6, 28.3],
]
},
'Huaraz': {
'desempleo_trimestral': [
["2022-Q1", 5.6, 4.1, 6.8],
["2022-Q2", 3.7, 4.9, 7.3],
["2022-Q3", 2.1, 3.5, 6.7],
["2022-Q4", 2.4, 2.8, 2.3],
["2023-Q1", 5.2, 4.1, 6.8],
["2023-Q2", 6.0, 4.9, 7.3],
["2023-Q3", 4.9, 3.5, 6.7],
["2023-Q4", 4.7, 5.0, 4.3],
["2024-Q1", 7.1, 5.5, 9.2],
["2024-Q2", 7.1, 8.0, 6.0],
["2024-Q3", 6.7, 8.0, 4.9],
["2024-Q4", 7.0, 7.7, 6.1],
],
'ingresos_periodo': [
["2022-04/2023-03", 1768.5, 2091.1, 1335.7],
["2022-07/2023-06", 1802.9, 2105.0, 1404.7],
["2022-10/2023-09", 1826.5, 2092.7, 1463.3],
["2023", 1862.5, 2121.2, 1497.5],
["2023-04/2024-03", 1870.7, 2119.2, 1520.4],
["2023-07/2024-06", 1909.0, 2153.3, 1565.4],
["2023-10/2024-09", 1902.1, 2114.9, 1607.4],
["2024", 1936.9, 2149.9, 1652.0],
],
'informal_periodo': [
# No hay datos num茅ricos espec铆ficos, solo inferencias de gr谩ficos.
],
'actividad_trimestral': [
["2023-Q1", 63.3, None, None],
["2023-Q3", 62.8, 71.6, 54.0],
["2024-Q1", 62.9, None, None],
["2024-Q3", 61.6, 70.0, 53.3],
],
'poblacion_ocupada': [
["2022-Q2", 62.5, 36.1, 26.4],
["2022-Q3", 68.6, 38.1, 30.5],
["2023-Q1", 65.1, 37.5, 27.5],
["2023-Q2", 65.3, 35.8, 29.5],
["2023-Q3", 65.3, 37.6, 27.8],
["2024-Q1", 64.5, 37.3, 27.3],
["2024-Q2", 64.0, 35.0, 29.0],
["2024-Q3", 64.0, 35.6, 28.3],
]
},
'Ica': {
'desempleo_trimestral': [
["2022-Q3", 3.1, None, None],
["2022-Q4", 5.3, 4.3, 6.6],
["2023-Q3", 7.6, 6.4, 9.0],
["2023-Q4", 5.3, 4.3, 6.6],
["2024-Q3", 7.1, 5.8, 8.9],
["2024-Q4", 8.2, 6.8, 10.0],
],
'ingresos_periodo': [
["2022-10/2023-09", 1969.4, 2172.6, 1696.0],
["2023-10/2024-09", 2055.1, 2276.2, 1750.1],
["2024", 2032.6, 2237.5, 1747.5],
],
'informal_periodo': [
# No hay datos num茅ricos espec铆ficos, solo inferencias de gr谩ficos.
],
'actividad_trimestral': [],
'poblacion_ocupada': [
["2022-Q3", 175.4, 99.7, 75.8],
["2023-Q1", 168.2, 98.6, 69.5],
["2023-Q2", 169.0, 95.4, 73.6],
["2023-Q3", 172.0, 96.1, 75.8],
["2024-Q1", 162.8, 94.2, 68.6],
["2024-Q2", 166.7, 97.2, 69.5],
["2024-Q3", 172.1, 99.5, 72.6],
]
},
'Iquitos': {
'desempleo_trimestral': [
["2022-Q3", 3.2, None, None],
["2022-Q4", 3.4, None, None],
["2023-Q1", 8.1, 7.4, 9.0],
["2023-Q2", 7.0, 6.2, 7.9],
["2023-Q3", 6.2, 6.6, 5.7],
["2023-Q4", 6.3, 5.3, 7.7],
["2024-Q1", 8.1, 7.4, 9.1],
["2024-Q2", 7.6, 6.1, 9.6],
["2024-Q3", 8.0, 8.1, 8.0],
["2024-Q4", 4.2, 3.7, 4.8],
],
'ingresos_periodo': [
["2022-04/2023-03", 1581.5, 1723.7, 1396.7],
["2022-07/2023-06", 1623.0, 1786.5, 1413.3],
["2022-10/2023-09", 1671.5, 1837.8, 1458.2],
["2023", 1702.8, 1884.1, 1467.3],
["2023-04/2024-03", 1728.4, 1919.9, 1476.4],
["2023-07/2024-06", 1716.9, 1891.9, 1480.4],
["2023-10/2024-09", 1725.3, 1894.0, 1494.4],
["2024", 1741.9, 1898.3, 1532.0],
],
'informal_periodo': [
["2022-07/2023-06", 73.8, None, None],
["2022-10/2023-09", 74.1, None, None],
["2023", 73.1, 71.6, 75.9],
["2023-04/2024-03", 73.8, None, None],
["2023-07/2024-06", 72.8, None, None],
["2023-10/2024-09", 72.8, None, None],
["2024", 72.4, None, None],
],
'actividad_trimestral': [
["2022", 72.5, None, None],
["2023-Q3", 69.4, None, None],
["2023", 70.3, None, None],
["2024-Q3", 71.8, None, None],
],
'poblacion_ocupada': [
["2022-Q1", 218.6, 119.4, 99.2],
["2022-Q2", 221.6, 124.1, 97.4],
["2022-Q3", 232.4, 127.8, 104.5],
["2023-Q1", 212.0, 119.7, 92.3],
["2023-Q2", 215.7, 117.4, 98.3],
["2023-Q3", 213.8, 119.2, 94.5],
["2024-Q3", 218.5, 123.4, 95.1],
]
},
'Lima Metropolitana y la Provincia Constitucional del Callao': {
'desempleo_trimestral': [
["2022-Q1", 9.4, 6.4, 8.7],
["2022-Q2", 6.8, None, None],
["2022-Q3", 7.7, None, None],
["2022-Q4", 7.1, None, None],
["2023-Q1", 7.5, 6.4, 8.7],
["2023-Q2", 6.6, 6.0, 7.1],
["2023-Q3", 6.7, 5.8, 7.8],
["2023-Q4", 6.4, 5.2, 7.8],
["2024-Q1", 7.7, 6.8, 8.7],
["2024-Q2", 6.6, 6.0, 7.3],
["2024-Q3", 5.9, 5.0, 7.1],
["2024-Q4", 5.5, 5.0, 6.1],
],
'ingresos_periodo': [
["2022-04/2023-03", 1949.9, 2213.6, 1627.9],
["2022-07/2023-06", 2032.3, 2294.5, 1715.2],
["2023", 2141.1, 2430.3, 1797.4],
["2023-04/2024-03", 2176.2, 2472.3, 1823.8],
["2023-07/2024-06", 2189.5, 2506.0, 1816.4],
["2023-10/2024-09", 2217.8, 2519.7, 1859.8],
["2024", 2268.9, 2565.8, 1915.4],
],
'informal_periodo': [
["2022-07/2023-06", 58.0, 55.3, 61.2],
["2023", 56.7, 53.9, 59.9],
["2023-04/2024-03", 57.3, 54.5, 60.6],
["2023-07/2024-06", 57.3, 54.6, 60.4],
["2023-10/2024-09", 57.3, 54.9, 60.1],
["2024", 57.0, 54.2, 60.2],
],
'actividad_trimestral': [
["2023-Q3", 65.4, None, None],
["2024-Q1", 66.7, None, None],
["2024-Q2", 66.5, None, None],
["2024-Q3", 65.4, None, None],
],
'poblacion_ocupada': [
["2022-Q1", 4921.1, 2732.9, 2188.3],
["2022-Q2", 5087.7, 2771.6, 2316.0],
["2022-Q3", 4982.9, 2734.5, 2248.4],
["2022-Q4", 5019.4, 2754.0, 2265.5],
["2023-Q1", 5124.4, 2749.1, 2375.3],
["2023-Q2", 5215.5, 2800.2, 2415.4],
["2023-Q3", 5208.3, 2823.0, 2385.2],
["2023-Q4", 5217.0, 2807.6, 2409.4],
["2024-Q1", 5359.7, 2892.8, 2466.9],
["2024-Q2", 5461.3, 2891.5, 2569.7],
["2024-Q3", 5461.7, 2985.0, 2476.8],
["2024-Q4", 5459.2, 2942.9, 2516.4],
]
},
'Moquegua': {
'desempleo_trimestral': [
["2022-Q1", 10.5, 9.7, 11.6],
["2022-Q2", 6.0, None, None],
["2022-Q3", 6.6, None, None],
["2022-Q4", 9.2, None, None],
["2023-Q1", 14.8, 12.9, 17.3],
["2023-Q2", 10.0, 9.2, 11.2],
###
["2023-Q3", 11.4, 10.8, 12.2],
["2023-Q4", 11.1, 9.7, 13.0],
["2024-Q1", 14.4, 11.3, 18.6],
["2024-Q2", 11.1, 8.6, 14.4],
["2024-Q3", 11.2, 8.1, 15.0],
["2024-Q4", 6.3, 6.8, 5.5],
],
'ingresos_periodo': [
["2022-04/2023-03", 2002.0, 2313.2, 1570.7],
["2022-07/2023-06", 2075.2, 2402.3, 1609.8],
["2022-10/2023-09", 2141.5, 2492.6, 1642.4],
["2023", 2174.3, 2517.8, 1673.8],
["2023-04/2024-03", 2195.7, 2516.1, 1729.2],
["2023-07/2024-06", 2206.9, 2517.5, 1756.6],
["2023-10/2024-09", 2222.2, 2540.8, 1766.5],
],
'informal_periodo': [
["2023", 54.1, 50.9, 58.5],
["2024",54.1,50.9,58.5]
],
'actividad_trimestral': [
["2023-Q1",64.2,None,None],
["2023-Q3",66.0,None,None],
["2024-Q1",69.1,None,None]
],
'poblacion_ocupada': [
["2022-Q2", 40.7, 23.2, 17.5],
["2022-Q3", 40.0, 23.4, 16.7],
["2023-Q1", 36.6, 21.4, 15.1],
["2023-Q2", 40.9, 24.2, 16.7],
["2023-Q3", 39.6, 23.2, 16.4],
["2024-Q1", 40.5, 23.7, 16.8],
["2024-Q2", 42.7, 25.2, 17.5],
["2024-Q3", 42.9, 24.6, 18.3],
]
},
'Moyobamba': {
'desempleo_trimestral': [
["2022-Q1", 3.7, 5.9, 6.1],
["2022-Q2", 1.8, 3.4, 2.7],
["2022-Q3", 1.1, 3.4, 4.4],
["2022-Q4", 1.9, 3.8, 6.1],
["2023-Q1", 6.0, 5.9, 6.1],
["2023-Q2", 3.2, 3.4, 2.7],
["2023-Q3", 3.8, 3.4, 4.4],
["2023-Q4", 4.3, 3.3, 5.8],
["2024-Q1", 6.8, 5.1, 9.2],
["2024-Q2", 3.4, 3.1, 3.8],
["2024-Q3", 4.0, 3.0, 5.3],
["2024-Q4", 3.0, 3.0, 3.1],
],
'ingresos_periodo': [
["2022-07/2023-06", 1778.8, 1927.2, 1554.4],
["2022-10/2023-09", 1753.7, 1893.1, 1537.0],
["2023", 1738.2, 1858.6, 1547.1],
["2023-04/2024-03", 1743.8, 1868.6, 1546.7],
["2023-07/2024-06", 1726.2, 1841.2, 1548.6],
["2023-10/2024-09", 1734.6, 1860.1, 1543.5],
["2024", 1730.3, 1882.3, 1504.7],
["2022-04/2023-03",1753.1,1905.7,1523.4]
],
'informal_periodo': [
["2023-10/2024-09",None,72.9,74.3],
["2024",None,70.3,68.5],
["2023-04/2024-03",69.0,69.2,68.6]
],
'actividad_trimestral': [
["2022-Q3", 72.6, None, None],
["2023-Q3", 72.6, None, None],
["2024-Q1", 73.7, None, None],
["2024-Q2", 73.5, None, None],
["2024-Q3", 73.1, None, None],
],
'poblacion_ocupada': [
["2022-Q1", 32.0, 19.0, 13.0],
["2022-Q2", 33.2, 19.6, 13.6],
["2022-Q3", 34.0, 19.9, 14.1],
["2023-Q1", 32.4, 19.0, 13.4],
["2023-Q2", 32.6, 19.4, 13.2],
["2023-Q3", 32.6, 19.6, 13.1],
["2024-Q1", 33.8, None, None],
["2024-Q2", 33.8, 19.3, 14.5],
["2024-Q3", 33.6, 19.6, 14.0],
]
},
'Cerro de Pasco': {
'desempleo_trimestral': [
["2022-Q1", 7.5, 5.8, 9.3],
["2022-Q2", 5.2, None, None],
["2022-Q3", 3.3, 5.3, 6.6],
["2022-Q4", 5.7, 3.2, 5.5],
["2023-Q1", 9.5, 7.9, 11.5],
["2023-Q2", 6.7, 6.7, 8.8],
["2023-Q3", 5.9, 5.3, 6.6],
["2023-Q4", 4.2, 3.2, 5.5],
["2024-Q1", 10.1, 9.1, 11.5],
["2024-Q2", 7.6, 6.8, 8.6],
["2024-Q3", 7.7, 7.6, 7.7],
["2024-Q4", 6.4, 5.1, 8.1],
],
'ingresos_periodo': [
["2022-04/2023-03", 1679.1, 2036.5, 1216.6],
["2022-07/2023-06", 1738.4, 2113.4, 1238.4],
["2022-10/2023-09", 1779.2, 2170.1, 1238.5],
["2023", 1783.2, 2162.7, 1245.5],
["2023-04/2024-03", 1811.3, 2190.5, 1271.8],
["2023-07/2024-06", 1808.9, 2210.8, 1252.4],
["2023-10/2024-09", 1844.0, 2269.1, 1270.0],
["2024", 1870.4, 2313.9, 1267.6],
],
'informal_periodo': [
# No hay datos num茅ricos espec铆ficos, solo inferencias de gr谩ficos.
],
'actividad_trimestral': [
["2023-Q3",64.8,None,None],
["2024-Q3",63.8,None,None]
],
'poblacion_ocupada': [
["2022-Q2", 28.9, 15.8, 13.1],
["2022-Q3", 29.5, 16.3, 13.2],
["2023-Q1", 27.5, 15.5, 12.0],
["2023-Q2", 29.4, 16.9, 12.5],
["2023-Q3", 28.4, 16.4, 12.0],
["2023-Q4", 28.4, 16.3, 12.1],
["2024-Q1", 24.2, 14.0, 10.2],
["2024-Q2", 27.2, 15.0, 12.2],
["2024-Q3", 27.3, 15.7, 11.6],
["2024-Q4", 26.6, 15.1, 11.4]
]
},
'Piura': {
'desempleo_trimestral': [
["2022-Q1", 5.4, None, None],
["2022-Q2", 3.2, None, None],
["2022-Q3", 2.9, None, None],
["2022-Q4", 3.4, None, None],
["2023-Q1", 9.2, 8.3, 10.1],
["2023-Q2", 6.7, 5.0, 8.7],
["2023-Q3", 6.0, 6.4, 5.5],
["2023-Q4", 6.6, 5.6, 7.7],
["2024-Q1", 9.5, 7.9, 11.2],
["2024-Q2", 8.2, 7.2, 9.4],
["2024-Q3", 6.9, 4.6, 9.5],
["2024-Q4", 8.0, 5.7, 10.7],
],
'ingresos_periodo': [
["2022-04/2023-03", 1799.1, 2055.2, 1490.1],
["2022-07/2023-06", 1805.6, 2064.7, 1494.2],
["2022-10/2023-09", 1842.5, 2101.1, 1533.2],
["2023", 1839.3, 2103.5, 1520.5],
["2023-04/2024-03", 1839.8, 2099.2, 1527.5],
["2023-07/2024-06", 1856.8, 2104.4, 1555.9],
["2023-10/2024-09", 1856.8, 2105.2, 1547.8],
["2024", 1856.5, 2084.4, 1569.8],
],
'informal_periodo': [
# No hay datos num茅ricos espec铆ficos, solo inferencias de gr谩ficos.
],
'actividad_trimestral': [
["2023-Q3", 70.1, None, None],
["2024-Q3", 69.0, None, None],
],
'poblacion_ocupada': [
["2022-Q3", 293.0, 159.1, 133.9],
]
},
'Pucallpa': {
'desempleo_trimestral': [
["2022-Q1", 4.2, None, None],
["2022-Q3", 2.0, None, None],
["2022-Q4", 1.9, None, None],
["2023-Q1", 4.7, 4.2, 5.4],
["2023-Q2", 2.9, 2.5, 3.6],
["2023-Q3", 5.7, 4.6, 7.3],
["2023-Q4", 4.8, 3.8, 6.1],
["2024-Q1", 6.6, 6.4, 6.8],
["2024-Q2", 7.4, 7.3, 7.5],
["2024-Q3", 4.9, 5.0, 4.8],
["2024-Q4", 4.6, 3.4, 6.1],
],
'ingresos_periodo': [
["2022-04/2023-03", 1583.0, 1698.1, 1412.8],
["2022-07/2023-06", 1587.9, 1712.9, 1402.5],
["2022-10/2023-09", 1591.5, 1714.7, 1404.1],
["2023", 1616.2, 1736.1, 1430.3],
["2023-04/2024-03", 1626.1, 1741.0, 1450.3],
["2023-07/2024-06", 1623.8, 1729.1, 1463.0],
["2023-10/2024-09", 1627.5, 1720.2, 1488.0],
["2024", 1628.0, 1711.5, 1501.3],
],
'informal_periodo': [
["2023-04/2024-03", 74.2, 72.9, 75.9],
],
'actividad_trimestral': [
["2023-Q1",68.3,None,None],
["2023-Q2",67.7,None,None],
["2023-Q3",66.2,None,None],
["2024-Q1",67.9,None,None],
["2024-Q2",66.1,None,None],
["2024-Q3",68.7,None,None]
],
'poblacion_ocupada': [
["2022-Q1", 189.1, 115.1, 74.0],
["2022-Q3", 232.4, 127.8, 104.5],
["2023-Q1", 190.0, 112.6, 77.4],
["2024-Q1",190.0,112.6,77.4]
]
},
'Puerto Maldonado': {
'desempleo_trimestral': [
["2022-Q4", 2.0, None, None],
["2023-Q1", 6.1, 4.9, 8.3],
["2023-Q2", 4.5, 3.9, 5.6],
["2023-Q3", 4.3, 2.9, 6.4],
["2023-Q4", 5.2, 4.3, 6.7],
["2024-Q1", 6.4, 3.9, 10.5],
["2024-Q2", 7.8, 6.0, 10.7],
["2024-Q3", 6.7, 5.2, 9.1],
["2024-Q4", 5.6, 4.3, 7.8],
],
'ingresos_periodo': [
["2022-04/2023-03", 1911.6, 2075.4, 1622.0],
["2022-07/2023-06", 1893.7, 2034.2, 1641.7],
["2022-10/2023-09", 1871.5, 2002.7, 1637.3],
["2023", 1869.8, 1995.4, 1645.5],
["2023-04/2024-03", 1872.8, 1992.9, 1654.6],
["2023-07/2024-06", 1904.0, 2037.4, 1662.8],
["2023-10/2024-09", 1955.6, 2095.1, 1700.2],
["2024", 1973.6, 2113.7, 1715.4],
],
'informal_periodo': [
["2022-04/2023-03",None,None,None],
["2022-07/2023-06",None,None,None],
["2022-10/2023-09",None,None,None],
["2023", 70.5, 72.0, 68.0],
["2023-04/2024-03", 70.7, 71.8, 68.9],
["2023-07/2024-06", 70.7, 71.8, 68.9],
["2023-10/2024-09", 70.3, 70.9, 69.1],
["2024", 73.5,72.5,73.5],
],
'actividad_trimestral': [
["2023-Q1",68.3,None,None],
["2023-Q2",74.8,None,None],
["2023-Q3",75.8,None,None],
["2024-Q1",72.4,None,None],
["2024-Q2",74.8,None,None],
["2024-Q3",72.2,None,None]
],
'poblacion_ocupada': [
["2022-Q2", 60.4, 38.6, 21.8],
["2022-Q3", 66.8, 42.3, 24.4],
["2023-Q1", 59.2, 37.5, 21.7],
["2023-Q2", 66.6, 41.7, 24.9],
["2023-Q3", 68.4, 42.5, 25.8],
["2024-Q2",66.8,42.0,24.7],
["2024-Q3",65.9,42.0,23.9]
]
},
'Puno': {
'desempleo_trimestral': [
["2023-Q1", 15.3, 13.4, 17.7],
["2023-Q2", 9.3, 10.3, 8.2],
["2023-Q3", 8.5, 8.8, 8.1],
["2023-Q4", 6.2, 6.1, 6.3],
["2024-Q1", 11.9, 10.9, 13.0],
["2024-Q2", 7.7, 7.2, 8.3],
["2024-Q3", 8.4, 7.1, 9.9],
["2024-Q4", 5.2, 5.7, 4.6],
],
'ingresos_periodo': [
["2022-04/2023-03", 1672.8, 1950.7, 1361.2],
["2022-07/2023-06", 1672.8, 1950.7, 1361.2],
["2022-10/2023-09", 1700.3, 1958.8, 1416.7],
["2023", 1731.9, 1977.9, 1462.7],
["2023-04/2024-03", 1763.4, 1995.6, 1508.9],
["2023-07/2024-06", 1809.9, 2038.3, 1556.1],
["2023-10/2024-09", 1789.5, 1996.4, 1552.3],
["2024", 1804.6, 2006.0, 1568.1],
],
'informal_periodo': [
# No hay datos num茅ricos espec铆ficos, solo inferencias de gr谩ficos.
],
'actividad_trimestral': [],
'poblacion_ocupada': []
},
'Tacna': {
'desempleo_trimestral': [
["2022-Q1", 7.1, None, None],
["2022-Q2", 3.5, None, None],
["2022-Q3", 2.7, None, None],
["2022-Q4", 2.8, None, None],
["2023-Q1", 8.8, 8.7, 8.9],
["2023-Q2", 7.4, 6.6, 8.4],
["2023-Q3", 5.9, 6.1, 5.7],
["2023-Q4", 5.1, 4.5, 6.0],
["2024-Q1", 8.5, 7.6, 9.7],
["2024-Q2", 8.3, 9.0, 7.5],
["2024-Q3", 6.6, 5.8, 7.6],
["2024-Q4", 6.1, 6.2, 6.0],
],
'ingresos_periodo': [
["2022-04/2023-03", 1536.4, 1708.2, 1313.5],
["2022-07/2023-06", 1568.6, 1737.1, 1349.7],
["2022-10/2023-09", 1603.6, 1766.7, 1394.7],
["2023", 1624.3, 1785.2, 1420.0],
["2023-04/2024-03", 1659.6, 1824.6, 1447.2],
["2023-07/2024-06", 1666.0, 1832.8, 1451.7],
["2023-10/2024-09", 1645.3, 1799.6, 1447.2],
["2024", 1686.6, 1850.7, 1474.1],
],
'informal_periodo': [
# No hay datos num茅ricos espec铆ficos, solo inferencias de gr谩ficos.
],
'actividad_trimestral': [
["2024-Q3",None,None,None]
],
'poblacion_ocupada': [
["2022-Q2", 158.2, 86.6, 71.6],
["2023-Q2", 161.5, 89.9, 71.6],
["2023-Q3", 166.0, 91.6, 74.5],
["2024-Q2", 165.4, 91.7, 73.6],
["2024-Q3", 167.0, 93.5, 73.6],
]
},
'Tarapoto': {
'desempleo_trimestral': [
["2022-Q1", 3.5, None, None],
["2022-Q2", 2.1, None, None],
["2022-Q3", 2.2, None, None],
["2022-Q4", 2.5, None, None],
["2023-Q1", 4.7, 4.4, 5.2], # Hay dos valores para hombres y mujeres
["2023-Q2", 4.6, 3.8, 5.6], # Hay dos valores para hombres y mujeres
["2023-Q3", 4.6, 5.2, 3.8], # Hay dos valores para hombres y mujeres
["2023-Q4", 4.4, 3.9, 5.1],
["2024-Q1", 5.8, 6.1, 5.4],
["2024-Q2", 5.0, 4.9, 5.2],
["2024-Q3", 4.0, 3.5, 4.7],
["2024-Q4", 2.8, 2.0, 4.0],
],
'ingresos_periodo': [
["2023-04/2024-03", 1903.9, 2136.1, 1583.3],
["2023-07/2024-06", 1928.3, 2163.4, 1608.5],
["2023-10/2024-09", 1981.4, 2214.1, 1661.9],
["2024", 2021.5, 2265.3, 1684.8],
["2022-04/2023-03",1863.4,2059.1,1580.5],
["2022-07/2023-06",1852.9,2051.5,1565.0],
["2022-10/2023-09",1863.1,2072.9,1560.7],
["2023",1893.2,2114.3,1579.0]
],
'informal_periodo': [
# No hay datos num茅ricos espec铆ficos, solo inferencias de gr谩ficos.
],
'actividad_trimestral': [
###
["2024-Q3", 72.2, None, None],
],
'poblacion_ocupada': [
["2022-Q1", 87.8, 51.9, 35.8],
["2023-Q1", 87.0, 50.9, 36.1],
]
},
'Trujillo': {
'desempleo_trimestral': [
["2022-Q1", 6.7, None, None],
["2022-Q2", 3.9, None, None],
["2022-Q3", 3.6, None, None],
["2022-Q4", 3.9, None, None],
["2023-Q1", 8.2, 5.3, 11.5],
["2023-Q2", 7.1, 5.6, 8.8],
["2023-Q3", 5.6, 3.5, 7.8],
["2023-Q4", 5.3, 4.0, 6.8],
["2024-Q1", 5.7, 4.7, 6.9],
["2024-Q2", 5.0, 3.2, 7.1],
["2024-Q3", 3.6, 2.1, 5.4],
["2024-Q4", 3.8, 2.7, 5.0],
],
'ingresos_periodo': [
["2022-04/2023-03", 1845.8, 2147.2, 1464.1],
["2022-07/2023-06", 1857.0, 2151.1, 1489.6],
["2022-10/2023-09", 1909.2, 2215.3, 1530.1],
["2023", 1975.4, 2298.1, 1586.4],
["2023-04/2024-03", 1987.4, 2319.0, 1592.1],
["2023-07/2024-06", 2012.6, 2340.0, 1614.7],
["2023-10/2024-09", 2013.9, 2304.1, 1654.2],
["2024", 1989.7, 2255.1, 1656.6],
],
'informal_periodo': [
# No hay datos num茅ricos espec铆ficos, solo inferencias de gr谩ficos.
],
'actividad_trimestral': [
["2023-Q3",None,None,None],
["2024-Q3",69.1,None,None]
],
'poblacion_ocupada': [
["2022-Q1", 490.8, 266.5, 224.2],
["2022-Q3", 505.0, 275.5, 229.5],
["2023-Q1", 542.4, 289.2, 253.3],
["2023-Q2", 500.1, 266.9, 233.2],
["2023-Q3", 542.4, 289.2, 253.3],
["2024-Q2", 515.9, 282.6, 233.3],
["2024-Q3", 536.0, 294.9, 241.0],
]
},
'Tumbes': {
'desempleo_trimestral': [
["2023-Q1", 6.3, 4.8, 8.4],
["2023-Q2", 5.7, 4.3, 7.7],
["2023-Q3", 5.2, 4.8, 5.9],
["2023-Q4", 5.9, 4.8, 7.7],
["2024-Q1", 6.7, 4.7, 9.6],
["2024-Q2", 7.0, 5.7, 8.8],
["2024-Q3", 7.4, 5.1, 10.9],
["2024-Q4", 6.9, 6.5, 7.4],
],
'ingresos_periodo': [
["2022-04/2023-03", 1554.9, 1663.3, 1376.7],
["2022-07/2023-06", 1590.2, 1710.0, 1395.6],
["2022-10/2023-09", 1623.7, 1765.0, 1397.3],
["2023", 1640.7, 1791.0, 1401.3],
["2023-04/2024-03", 1654.5, 1809.0, 1409.6],
["2023-07/2024-06", 1701.0, 1853.8, 1464.9],
["2023-10/2024-09", 1732.5, 1867.3, 1520.9],
["2024", 1779.2, 1918.3, 1557.7],
],
'informal_periodo': [
["2022-04/2023-03", 68.6, 70.2, 66.1],
["2024",None,61.5,68.5]
],
'actividad_trimestral': [
["2023-Q3",69.4,None,None],
["2024-Q1",67.2,None,None],
["2024-Q3",68.5,None,None]
],
'poblacion_ocupada': [
["2023-Q1", 52.5, 31.6, 20.9],
["2023-Q2", 52.1, 31.6, 20.5],
]
},
'Juliaca': {
'desempleo_trimestral': [
["2023-Q4", 6.3, 6.3, 6.3],
["2024-Q4", 7.6, 7.6, 7.6],
],
'ingresos_periodo': [
["2023", 1298.6, 1638.7, 899.9],
["2024", 1298.6, 1638.7, 899.9]
],
'informal_periodo': [
# No hay datos num茅ricos espec铆ficos, solo inferencias de gr谩ficos.
],
'actividad_trimestral': [],
'poblacion_ocupada': []
}
}
plt.rcParams['figure.figsize'] = (14, 9)
plt.rcParams['font.size'] = 13
plt.rcParams['font.family'] = 'sans-serif'
plt.style.use('seaborn-v0_8-whitegrid')
COLORES = {
'Total': '#2C3E50',
'Hombres': '#3498DB',
'Mujeres': '#E74C3C',
'Brecha': '#8E44AD',
'Fondo': '#F8F9F9'
}
def normalizar_nombres_ciudades(nombre):
correcciones = {
'M谩nuco': 'Moquegua',
'Maraz': 'Ica',
'Ruino': 'Hu谩nuco',
'Alma Memoritana y la Provincia, Polesita General del Calleo': 'Callao',
'Montenor': 'Huacho',
'Necesidades': 'Cerro de Pasco',
'Conocimiento': 'Tarapoto',
'Pura': 'Piura',
'Posalipa': 'Pucallpa',
'Tagapito': 'Talara',
'Juliana': 'Juliaca'
}
return correcciones.get(nombre, nombre)
def ordenar_trimestres(df, col_fecha='Trimestre'):
df = df.copy()
if col_fecha == 'Trimestre':
fechas = []
for t in df[col_fecha]:
if 'Q' in t:
a帽o = t.split('-')[0]
trimestre = t.split('-')[1]
mes = {'Q1': '03', 'Q2': '06', 'Q3': '09', 'Q4': '12'}[trimestre]
fechas.append(f"{a帽o}-{mes}")
else:
fechas.append(f"{t}-01")
df['fecha_orden'] = pd.to_datetime(fechas, format='%Y-%m')
else:
fechas = []
for p in df[col_fecha]:
if '/' in p:
fechas.append(p.split('/')[0])
else:
fechas.append(f"{p}-01")
df['fecha_orden'] = pd.to_datetime(fechas, format='%Y-%m', errors='coerce')
df = df.sort_values('fecha_orden')
return df
def calcular_rango_y(df, categorias, padding=0.15):
valores = df[categorias].values.flatten()
valores = valores[~np.isnan(valores)]
if len(valores) == 0:
return (0, 1)
min_val = np.nanmin(valores)
max_val = np.nanmax(valores)
rango = max_val - min_val
return (max(0, min_val - rango*padding), max_val + rango*padding)
def graficar_datos_mejorados(df, titulo, subtitulo, ylabel, col_fecha='Trimestre', mostrar_valores=True, formato_valores='.1f'):
fig, ax = plt.subplots(figsize=(14, 8))
ax.set_facecolor(COLORES['Fondo'])
fig.patch.set_facecolor(COLORES['Fondo'])
ax.grid(axis='y', linestyle='--', alpha=0.7)
categorias = df.columns[1:4]
x_indices = np.arange(len(df))
ylim = calcular_rango_y(df, categorias)
for categoria in categorias:
if categoria in df.columns and not df[categoria].isna().all():
y_vals = df[categoria].values
valid_mask = ~np.isnan(y_vals)
ax.plot(x_indices[valid_mask], y_vals[valid_mask],
marker='o', linewidth=3, markersize=8,
label=categoria, color=COLORES[categoria])
if mostrar_valores:
for i, valor in zip(x_indices[valid_mask], y_vals[valid_mask]):
offset = 0.2 if categoria == 'Hombres' else -0.8 if categoria == 'Mujeres' else 0
ax.annotate(f'{valor:{formato_valores}}',
xy=(i, valor),
xytext=(0, 5 + offset),
textcoords='offset points',
ha='center', va='bottom',
fontsize=10, fontweight='bold',
color=COLORES[categoria],
bbox=dict(boxstyle='round,pad=0.3', fc='white', alpha=0.7))
ax.set_title(titulo, fontsize=18, fontweight='bold', pad=20)
plt.figtext(0.5, 0.01, subtitulo, ha='center', fontsize=12, fontstyle='italic')
ax.set_ylabel(ylabel, fontsize=14, fontweight='bold')
ax.set_xticks(x_indices)
ax.set_xticklabels(df[col_fecha].astype(str), rotation=45, ha='right')
ax.set_ylim(ylim)
for spine in ['top', 'right']:
ax.spines[spine].set_visible(False)
legend = ax.legend(fontsize=12, frameon=True, framealpha=0.9,
facecolor='white', edgecolor='lightgrey',
loc='upper right', bbox_to_anchor=(0.98, 0.98))
plt.tight_layout(rect=[0, 0.03, 1, 1])
return fig
def generar_analisis_global():
figuras = []
estilo_comun = {
'marker': 'o',
'linewidth': 2,
'markersize': 6,
'alpha': 0.8
}
# Gr谩fico de Desempleo Global
fig_desempleo = Figure(figsize=(16, 10))
ax_desempleo = fig_desempleo.add_subplot(111)
for ciudad, datos in cities_data.items():
nombre = normalizar_nombres_ciudades(ciudad)
df = ordenar_trimestres(pd.DataFrame(datos['desempleo_trimestral'],
columns=["Trimestre", "Total", "Hombres", "Mujeres"]))
if not df.empty:
ax_desempleo.plot(df['fecha_orden'], df['Total'],
label=nombre, **estilo_comun)
ax_desempleo.set_title('TASA DE DESEMPLEO - COMPARATIVA ENTRE CIUDADES',
fontsize=18, fontweight='bold', pad=20)
ax_desempleo.set_ylabel('Tasa (%)', fontsize=14)
ax_desempleo.grid(True, linestyle='--', alpha=0.5)
ax_desempleo.xaxis.set_major_locator(mdates.YearLocator())
ax_desempleo.xaxis.set_major_formatter(mdates.DateFormatter('%Y'))
handles, labels = ax_desempleo.get_legend_handles_labels()
leg = fig_desempleo.legend(handles, labels,
loc='upper center',
bbox_to_anchor=(0.5, -0.12),
ncol=5,
fontsize=10,
frameon=True,
fancybox=True,
shadow=True,
title='Ciudades',
title_fontsize='12')
fig_desempleo.tight_layout(rect=[0, 0.1, 1, 0.95])
figuras.append(fig_desempleo)
# Gr谩fico de Ingresos Global
fig_ingresos = Figure(figsize=(16, 10))
ax_ingresos = fig_ingresos.add_subplot(111)
for ciudad, datos in cities_data.items():
nombre = normalizar_nombres_ciudades(ciudad)
df = ordenar_trimestres(pd.DataFrame(datos['ingresos_periodo'],
columns=["Periodo", "Total", "Hombres", "Mujeres"]),
'Periodo')
if not df.empty:
ax_ingresos.plot(df['fecha_orden'], df['Total'],
label=nombre, **estilo_comun)
ax_ingresos.set_title('INGRESOS PROMEDIO - COMPARATIVA ENTRE CIUDADES',
fontsize=18, fontweight='bold', pad=20)
ax_ingresos.set_ylabel('Ingresos (Soles)', fontsize=14)
ax_ingresos.grid(True, linestyle='--', alpha=0.5)
ax_ingresos.xaxis.set_major_locator(mdates.YearLocator())
ax_ingresos.xaxis.set_major_formatter(mdates.DateFormatter('%Y'))
handles, labels = ax_ingresos.get_legend_handles_labels()
leg = fig_ingresos.legend(handles, labels,
loc='upper center',
bbox_to_anchor=(0.5, -0.12),
ncol=5,
fontsize=10,
frameon=True,
fancybox=True,
shadow=True,
title='Ciudades',
title_fontsize='12')
fig_ingresos.tight_layout(rect=[0, 0.1, 1, 0.95])
figuras.append(fig_ingresos)
# Gr谩fico de Brecha Salarial Global
fig_brecha = Figure(figsize=(16, 10))
ax_brecha = fig_brecha.add_subplot(111)
for ciudad, datos in cities_data.items():
nombre = normalizar_nombres_ciudades(ciudad)
df = ordenar_trimestres(pd.DataFrame(datos['ingresos_periodo'],
columns=["Periodo", "Total", "Hombres", "Mujeres"]),
'Periodo')
if not df.empty and 'Hombres' in df.columns and 'Mujeres' in df.columns:
df['Brecha'] = (df['Hombres'] - df['Mujeres']) / df['Hombres'] * 100
ax_brecha.plot(df['fecha_orden'], df['Brecha'],
label=nombre, **estilo_comun)
ax_brecha.set_title('BRECHA SALARIAL DE G脡NERO - COMPARATIVA ENTRE CIUDADES',
fontsize=18, fontweight='bold', pad=20)
ax_brecha.set_ylabel('Brecha (%)', fontsize=14)
ax_brecha.grid(True, linestyle='--', alpha=0.5)
ax_brecha.xaxis.set_major_locator(mdates.YearLocator())
ax_brecha.xaxis.set_major_formatter(mdates.DateFormatter('%Y'))
handles, labels = ax_brecha.get_legend_handles_labels()
leg = fig_brecha.legend(handles, labels,
loc='upper center',
bbox_to_anchor=(0.5, -0.12),
ncol=5,
fontsize=10,
frameon=True,
fancybox=True,
shadow=True,
title='Ciudades',
title_fontsize='12')
fig_brecha.tight_layout(rect=[0, 0.1, 1, 0.95])
figuras.append(fig_brecha)
return figuras
def load_data(city):
data = cities_data[city]
return [
data['desempleo_trimestral'],
data['ingresos_periodo'],
data['informal_periodo'],
data['actividad_trimestral'],
data['poblacion_ocupada']
]
def generate_plots(desempleo_df, ingresos_df, informal_df, actividad_df, poblacion_df):
dfs = {
'desempleo': pd.DataFrame(desempleo_df, columns=["Trimestre", "Total", "Hombres", "Mujeres"]),
'ingresos': pd.DataFrame(ingresos_df, columns=["Periodo", "Total", "Hombres", "Mujeres"]),
'informal': pd.DataFrame(informal_df, columns=["Periodo", "Total", "Hombres", "Mujeres"]),
'actividad': pd.DataFrame(actividad_df, columns=["Trimestre", "Total", "Hombres", "Mujeres"]),
'poblacion': pd.DataFrame(poblacion_df, columns=["Trimestre", "Total", "Hombres", "Mujeres"])
}
for key in dfs:
for col in ["Total", "Hombres", "Mujeres"]:
dfs[key][col] = pd.to_numeric(dfs[key][col], errors='coerce')
for key in dfs:
dfs[key] = ordenar_trimestres(dfs[key], 'Trimestre' if key in ['desempleo', 'actividad', 'poblacion'] else 'Periodo')
figs = []
# Radar Plot
problem_metrics = {
'Desempleo': dfs['desempleo']['Total'].iloc[-1] if not dfs['desempleo'].empty else 0,
'Informalidad': dfs['informal']['Total'].iloc[-1] if not dfs['informal'].empty else 0,
'Brecha Salarial': (
(dfs['ingresos']['Hombres'].iloc[-1] - dfs['ingresos']['Mujeres'].iloc[-1]) /
dfs['ingresos']['Hombres'].iloc[-1] * 100
if not dfs['ingresos'].empty and pd.notna(dfs['ingresos']['Hombres'].iloc[-1]) and pd.notna(dfs['ingresos']['Mujeres'].iloc[-1]) else 0
),
'Actividad': dfs['actividad']['Total'].iloc[-1] if not dfs['actividad'].empty else 0
}
categories = list(problem_metrics.keys())
values = list(problem_metrics.values())
angles = np.linspace(0, 2*np.pi, len(categories), endpoint=False).tolist()
values += values[:1]
angles += angles[:1]
fig_radar, ax_radar = plt.subplots(figsize=(10, 10), subplot_kw=dict(polar=True))
ax_radar.fill(angles, values, color=COLORES['Brecha'], alpha=0.2)
ax_radar.set_theta_offset(np.pi/2)
ax_radar.set_theta_direction(-1)
ax_radar.set_thetagrids(np.degrees(angles[:-1]), labels=categories)
ax_radar.set_rlabel_position(0)
plt.yticks([20,40,60,80], ["20%","40%","60%","80%"], color="grey", size=10)
plt.ylim(0,100)
ax_radar.set_title(f'RADAR DE PROBLEM脕TICAS LABORALES\n{dfs["desempleo"]["Trimestre"].iloc[-1]}',
pad=20, fontsize=14, fontweight='bold')
figs.append(fig_radar)
# Gr谩ficos principales
figs.append(graficar_datos_mejorados(dfs['desempleo'], 'TASA DE DESEMPLEO', 'Evoluci贸n por g茅nero', 'Tasa (%)'))
figs.append(graficar_datos_mejorados(dfs['ingresos'], 'INGRESOS PROMEDIO', 'Por per铆odo y g茅nero', 'Ingreso (soles)', col_fecha='Periodo', formato_valores='.0f'))
figs.append(graficar_datos_mejorados(dfs['informal'], 'TASA DE INFORMALIDAD', 'Por per铆odo', 'Tasa (%)', col_fecha='Periodo'))
figs.append(graficar_datos_mejorados(dfs['actividad'], 'TASA DE ACTIVIDAD', 'Participaci贸n econ贸mica', 'Tasa (%)'))
figs.append(graficar_datos_mejorados(dfs['poblacion'], 'POBLACI脫N OCUPADA', 'En miles de personas', 'Poblaci贸n (miles)'))
# Brecha Salarial
ingresos = dfs['ingresos']
brecha = []
for h, m in zip(ingresos['Hombres'], ingresos['Mujeres']):
if pd.notna(h) and pd.notna(m) and h != 0:
brecha.append((h-m)/h*100)
else:
brecha.append(np.nan)
fig_brecha, ax_brecha = plt.subplots(figsize=(14,8))
valid_indices = [i for i, b in enumerate(brecha) if pd.notna(b)]
valid_periods = [str(ingresos['Periodo'].iloc[i]) for i in valid_indices]
valid_brecha = [brecha[i] for i in valid_indices]
if valid_periods:
bars = ax_brecha.bar(valid_periods, valid_brecha, color=COLORES['Brecha'])
for bar in bars:
height = bar.get_height()
ax_brecha.text(bar.get_x() + bar.get_width()/2., height + 0.5,
f'{height:.1f}%', ha='center', va='bottom',
fontsize=10, fontweight='bold')
ax_brecha.set_title('BRECHA SALARIAL DE G脡NERO', fontsize=18, pad=20)
ax_brecha.set_ylabel('Brecha (%)', fontsize=14)
ax_brecha.grid(axis='y', linestyle='--', alpha=0.7)
figs.append(fig_brecha)
return figs
with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue"), css=".gradio-container {background-color: #F8F9F9}") as app:
gr.Markdown("# 馃搳 Dashboard de Indicadores Laborales por G茅nero")
gr.Markdown("Analiza los principales indicadores del mercado laboral con perspectiva de g茅nero")
with gr.Row():
city = gr.Dropdown(
list(cities_data.keys()),
label="Seleccione una Ciudad",
value="Chimbote",
info="Elija la ciudad para visualizar sus datos"
)
with gr.Tab("Datos"):
with gr.Accordion("Tasa de Desempleo", open=True):
desempleo_df = gr.Dataframe(
headers=["Trimestre", "Total", "Hombres", "Mujeres"],
datatype=["str", "number", "number", "number"],
label="Datos de Desempleo"
)
with gr.Accordion("Ingresos", open=False):
ingresos_df = gr.Dataframe(
headers=["Periodo", "Total", "Hombres", "Mujeres"],
datatype=["str", "number", "number", "number"],
label="Datos de Ingresos"
)
with gr.Accordion("Informalidad", open=False):
informal_df = gr.Dataframe(
headers=["Periodo", "Total", "Hombres", "Mujeres"],
datatype=["str", "number", "number", "number"],
label="Datos de Informalidad"
)
with gr.Accordion("Actividad Econ贸mica", open=False):
actividad_df = gr.Dataframe(
headers=["Trimestre", "Total", "Hombres", "Mujeres"],
datatype=["str", "number", "number", "number"],
label="Datos de Actividad"
)
with gr.Accordion("Poblaci贸n Ocupada", open=False):
poblacion_df = gr.Dataframe(
headers=["Trimestre", "Total", "Hombres", "Mujeres"],
datatype=["str", "number", "number", "number"],
label="Datos de Poblaci贸n Ocupada"
)
btn = gr.Button("Generar Visualizaciones", variant="primary")
with gr.Tab("Visualizaciones"):
with gr.Row():
radar_plot = gr.Plot(label="Radar de Problem谩ticas Laborales")
with gr.Row():
desempleo_plot = gr.Plot(label="Tasa de Desempleo")
with gr.Row():
ingresos_plot = gr.Plot(label="Ingresos Promedio")
brecha_salarial_plot = gr.Plot(label="Brecha Salarial de G茅nero")
with gr.Row():
informalidad_plot = gr.Plot(label="Tasa de Informalidad")
actividad_plot = gr.Plot(label="Tasa de Actividad")
with gr.Row():
poblacion_plot = gr.Plot(label="Poblaci贸n Ocupada")
with gr.Tab("An谩lisis Global"):
gr.Markdown("## An谩lisis Comparativo entre Ciudades")
global_btn = gr.Button("Generar An谩lisis Global", variant="primary")
with gr.Row():
global_desempleo_plot = gr.Plot(label="Comparativa de Desempleo")
with gr.Row():
global_ingresos_plot = gr.Plot(label="Comparativa de Ingresos")
with gr.Row():
global_brecha_plot = gr.Plot(label="Comparativa de Brecha Salarial")
city.change(
fn=load_data,
inputs=city,
outputs=[desempleo_df, ingresos_df, informal_df, actividad_df, poblacion_df]
)
btn.click(
fn=generate_plots,
inputs=[desempleo_df, ingresos_df, informal_df, actividad_df, poblacion_df],
outputs=[
radar_plot,
desempleo_plot,
ingresos_plot,
informalidad_plot,
actividad_plot,
poblacion_plot,
brecha_salarial_plot
]
)
global_btn.click(
fn=generar_analisis_global,
inputs=[],
outputs=[global_desempleo_plot, global_ingresos_plot, global_brecha_plot]
)
app.launch(debug=True)