Miguel Gómez Prieto commited on
Commit
4c4be9f
·
1 Parent(s): f47659f

Datast upload

Browse files
LinksObtainer.py ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from playwright.sync_api import sync_playwright
2
+ from urllib.parse import urljoin
3
+ import time, sys
4
+
5
+ BASE_URL = "https://europa.eu/eures/portal/jv-se/search"
6
+ DEFAULT_PARAMS = {
7
+ "page": "1",
8
+ "resultsPerPage": "50",
9
+ "orderBy": "BEST_MATCH",
10
+ "locationCodes": "es",
11
+ "lang": "en",
12
+ }
13
+
14
+ def build_search_url(params=None):
15
+ params = params or DEFAULT_PARAMS
16
+ query = "&".join(f"{k}={v}" for k, v in params.items())
17
+ return f"{BASE_URL}?{query}"
18
+
19
+
20
+ def get_offer_links(max_pages=3, wait_ms=1500, headless=True, params=None, start_page=1):
21
+ all_links = []
22
+
23
+ try:
24
+ with sync_playwright() as p:
25
+ browser = p.chromium.launch(headless=headless)
26
+ context = browser.new_context()
27
+ page = context.new_page()
28
+
29
+ for page_num in range(start_page, max_pages + 1):
30
+ try:
31
+ local_params = dict(params or DEFAULT_PARAMS)
32
+ local_params["page"] = str(page_num)
33
+ url = build_search_url(local_params)
34
+
35
+ page.goto(url, wait_until="networkidle", timeout=15000)
36
+ time.sleep(wait_ms / 1000.0)
37
+
38
+ anchors = page.locator("a[id^='jv-result-summary-title-']").all()
39
+ if not anchors:
40
+ print(f"\n[!] Página {page_num} sin resultados, deteniendo.")
41
+ break
42
+
43
+ for a in anchors:
44
+ href = a.get_attribute("href")
45
+ if href:
46
+ full_url = urljoin("https://europa.eu", href)
47
+ all_links.append(full_url)
48
+
49
+ # Progreso en vivo
50
+ progress = (page_num / max_pages) * 100
51
+ sys.stdout.write(
52
+ f"\rProgreso: {progress:.1f}% | URLs recogidas: {len(all_links)}"
53
+ )
54
+ sys.stdout.flush()
55
+
56
+ except Exception as e:
57
+ print(f"\n[!] Error en página {page_num}: {e}")
58
+ break
59
+
60
+ browser.close()
61
+
62
+ except Exception as e:
63
+ print(f"\n[!] Error general: {e}")
64
+
65
+ # Deduplicar
66
+ seen, deduped = set(), []
67
+ for link in all_links:
68
+ if link not in seen:
69
+ seen.add(link)
70
+ deduped.append(link)
71
+
72
+ print("\n[✓] Scraping completado.")
73
+ return deduped
74
+
75
+
76
+ if __name__ == "__main__":
77
+ from datetime import datetime
78
+ import os
79
+
80
+ inicio = datetime.now()
81
+ script_dir = os.path.dirname(os.path.abspath(__file__))
82
+ timestamp = datetime.now().strftime("%d_%H%M%S")
83
+
84
+ # Obtenemos los links
85
+ urls = get_offer_links(100000, 500, start_page=202)
86
+
87
+ print(len(urls))
88
+ print(timestamp)
89
+ print()
90
+
91
+ fin = datetime.now()
92
+ duracion = fin - inicio
93
+ print(f"Duración en segundos: {duracion.total_seconds()}")
94
+
95
+ file_path = os.path.join(script_dir, "links", f"links{timestamp}.txt")
96
+ with open(file_path, "w") as f:
97
+ f.writelines([url + "\n" for url in urls])
98
+ print()
99
+ print("URL guardadas en: "+ file_path)
OfferScrapper.py ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from playwright.sync_api import sync_playwright
2
+ import threading
3
+ import time
4
+ from langdetect import detect
5
+ import glob
6
+ import csv
7
+ import os
8
+
9
+ from datetime import datetime
10
+
11
+ def parse_fecha_limite(dia, mes_texto, anio):
12
+ # Construimos un string tipo "24 octubre 2025"
13
+ fecha_str = f"{dia} {mes_texto} {anio}"
14
+ # Parseamos con strptime (en español funciona si tu locale está en es_ES)
15
+ try:
16
+ fecha = datetime.strptime(fecha_str, "%d %B %Y")
17
+ return fecha.strftime("%d/%m/%Y")
18
+ except ValueError:
19
+ # Si falla porque el locale no reconoce el mes, puedes mapearlo manualmente
20
+ meses = {
21
+ "enero": "01", "febrero": "02", "marzo": "03", "abril": "04",
22
+ "mayo": "05", "junio": "06", "julio": "07", "agosto": "08",
23
+ "septiembre": "09", "octubre": "10", "noviembre": "11", "diciembre": "12"
24
+ }
25
+ mes_num = meses.get(mes_texto.lower(), "01")
26
+ return f"{dia}/{mes_num}/{anio}"
27
+
28
+
29
+ def log_fallida(url):
30
+ with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "ofertas", f"fallidas.txt"), "a", encoding="utf-8") as f:
31
+ f.write(url + "\n")
32
+
33
+ def append_to_csv(data, archivo_csv):
34
+ campos = [
35
+ "url",
36
+ "fecha_publicacion",
37
+ "fecha_limite",
38
+ "titulo",
39
+ "empresa",
40
+ "ocupacion",
41
+ "educacion",
42
+ "descripcion",
43
+ "pais",
44
+ "region",
45
+ "duracion_jornada",
46
+ "tipo_contrato"
47
+ ]
48
+
49
+ # Crear el archivo con cabecera si no existe
50
+ archivo_nuevo = not os.path.exists(archivo_csv)
51
+ with open(archivo_csv, mode="a", newline="", encoding="utf-8") as f:
52
+ writer = csv.DictWriter(f, fieldnames=campos)
53
+ if archivo_nuevo:
54
+ writer.writeheader()
55
+ writer.writerow(data)
56
+
57
+ def clean_language(url):
58
+ if url[-2:] == "en":
59
+ url = url[:-2] + "es"
60
+ # print(url)
61
+ return url
62
+
63
+ def cargar_urls_por_bloques(directorio="links", bloque=1000):
64
+ archivos = sorted(glob.glob(os.path.join(directorio, "*.txt")))
65
+ buffer = []
66
+
67
+ for archivo in archivos:
68
+ with open(archivo, "r") as f:
69
+ for linea in f:
70
+ url = linea.strip()
71
+ if url:
72
+ buffer.append(url)
73
+ if len(buffer) == bloque:
74
+ yield buffer
75
+ buffer = []
76
+ if buffer:
77
+ yield buffer # Último bloque, aunque tenga menos de 1000
78
+
79
+ def scrape_offer(url):
80
+ """
81
+ Extrae campos clave de una oferta EURES usando Playwright.
82
+ """
83
+ data = {"url": url}
84
+
85
+ with sync_playwright() as p:
86
+ browser = p.chromium.launch(headless=True)
87
+ context = browser.new_context()
88
+ page = context.new_page()
89
+ page.goto(url, wait_until="networkidle")
90
+ time.sleep(1.5)
91
+
92
+ def safe_text(selector, by="id"):
93
+ try:
94
+ if by == "id":
95
+ return page.locator(f"#{selector}").first.inner_text().strip()
96
+ elif by == "class":
97
+ return page.locator(f".{selector}").first.inner_text().strip()
98
+ except:
99
+ return None
100
+
101
+ # Fecha: primero intenta el id normal, si no, prueba el alternativo
102
+ fecha = safe_text("jv-lastModificationDate")
103
+ if not fecha:
104
+ fecha = safe_text("jv-lastModificationDate-no-title")
105
+
106
+ data["fecha_publicacion"] = fecha
107
+ data["titulo"] = safe_text("jv-title")
108
+ data["empresa"] = safe_text("jv-details-employer-name")
109
+ data["descripcion"] = safe_text("jv-details-job-description")
110
+ data["pais"] = safe_text("jv-address-country", by="class")
111
+ data["region"] = safe_text("jv-address-region", by="class")
112
+ data["duracion_jornada"] = safe_text("jv-position-schedule-result-0")
113
+ data["tipo_contrato"] = safe_text("jv-position-type-code-result")
114
+ data["ocupacion"] = safe_text("jv-job-categories-codes-result-0")
115
+ data["educacion"] = safe_text("ecl-description-list__definition", by="class")
116
+
117
+ try:
118
+ dia = page.locator(".ecl-date-block__day").first.inner_text().strip()
119
+ mes = page.locator(".ecl-date-block__month").first.get_attribute("title").strip()
120
+ anio = page.locator(".ecl-date-block__year").first.inner_text().strip()
121
+ data["fecha_limite"] = parse_fecha_limite(dia, mes, anio)
122
+ except:
123
+ data["fecha_limite"] = None
124
+
125
+
126
+ browser.close()
127
+
128
+ return data
129
+
130
+
131
+ def scrape_batch(urls, batch_size=3, sleep_time=2.5):
132
+ """
133
+ Procesa las URLs en grupos de `batch_size` en paralelo.
134
+ """
135
+ results = []
136
+
137
+ def worker(url):
138
+ try:
139
+ result = scrape_offer(url)
140
+ results.append(result)
141
+ except Exception as e:
142
+ print(f"[✗] Falló: {url} → {e}")
143
+ log_fallida(url)
144
+
145
+
146
+ for i in range(0, len(urls), batch_size):
147
+ threads = []
148
+ for url in urls[i:i+batch_size]:
149
+ t = threading.Thread(target=worker, args=(url,))
150
+ t.start()
151
+ threads.append(t)
152
+ for t in threads:
153
+ t.join()
154
+ time.sleep(sleep_time) # pausa entre lotes para evitar bloqueo
155
+
156
+ return results
157
+
158
+
159
+ if __name__ == "__main__":
160
+
161
+ inicio = datetime.now()
162
+ script_dir = os.path.dirname(os.path.abspath(__file__))
163
+ timestamp = datetime.now().strftime("%d_%H%M%S")
164
+ links_path = os.path.join(script_dir, "links")
165
+ file_path = os.path.join(script_dir, "ofertas", f"ofertas{timestamp}.csv")
166
+ leidos_path = os.path.join(script_dir, "ofertas", f"leidas.txt")
167
+ print("Starting")
168
+ for i, urls in enumerate(cargar_urls_por_bloques(links_path, 100)):
169
+ print(f"Procesando bloque {i + 1} con {len(urls)} URLs", end="")
170
+
171
+ resultados = scrape_batch([clean_language(url) for url in urls], batch_size=50, sleep_time=0.25)
172
+ for data in resultados:
173
+ append_to_csv(data, file_path)
174
+
175
+ with open(leidos_path, "a") as f:
176
+ f.writelines([url + "\n" for url in urls])
177
+
178
+ fin = datetime.now()
179
+ duracion = fin - inicio
180
+ print("Finalizado!")
181
+ print(f"Duración en segundos: {duracion.total_seconds()}")
OfferScrapperFast.py ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import asyncio
2
+ import csv
3
+ import glob
4
+ import os
5
+ from datetime import datetime
6
+ from playwright.async_api import async_playwright, TimeoutError as PlaywrightTimeoutError
7
+
8
+ # -------------------------------
9
+ # Utilidades
10
+ # -------------------------------
11
+
12
+ def parse_fecha_limite(dia, mes_texto, anio):
13
+ meses = {
14
+ "enero": "01", "febrero": "02", "marzo": "03", "abril": "04",
15
+ "mayo": "05", "junio": "06", "julio": "07", "agosto": "08",
16
+ "septiembre": "09", "octubre": "10", "noviembre": "11", "diciembre": "12"
17
+ }
18
+ mes_num = meses.get(mes_texto.lower(), "01")
19
+ return f"{dia}/{mes_num}/{anio}"
20
+
21
+ def log_fallida(url):
22
+ base = os.path.dirname(os.path.abspath(__file__))
23
+ with open(os.path.join(base, "ofertasFast", "fallidas.txt"), "a", encoding="utf-8") as f:
24
+ f.write(url + "\n")
25
+
26
+ def append_to_csv(data, archivo_csv):
27
+ campos = [
28
+ "url","fecha_publicacion","fecha_limite","titulo","empresa","ocupacion",
29
+ "educacion","descripcion","pais","region","duracion_jornada","tipo_contrato"
30
+ ]
31
+ archivo_nuevo = not os.path.exists(archivo_csv)
32
+ with open(archivo_csv, mode="a", newline="", encoding="utf-8") as f:
33
+ writer = csv.DictWriter(f, fieldnames=campos)
34
+ if archivo_nuevo:
35
+ writer.writeheader()
36
+ writer.writerow(data)
37
+
38
+ def clean_language(url):
39
+ return url[:-2] + "es" if url.endswith("en") else url
40
+
41
+ def cargar_urls_por_bloques(directorio="links", bloque=1000, archivo= False):
42
+ if archivo:
43
+ archivos = glob.glob(directorio)
44
+ else:
45
+ archivos = sorted(glob.glob(os.path.join(directorio, "*.txt")))
46
+ buffer = []
47
+ for archivo in archivos:
48
+ with open(archivo, "r") as f:
49
+ for linea in f:
50
+ url = linea.strip()
51
+ if url:
52
+ buffer.append(url)
53
+ if len(buffer) == bloque:
54
+ yield buffer
55
+ buffer = []
56
+ if buffer:
57
+ yield buffer
58
+
59
+ # -------------------------------
60
+ # Scraper asíncrono
61
+ # -------------------------------
62
+
63
+ async def scrape_offer(context, url, sem):
64
+ data = {"url": url}
65
+ async with sem: # limitar concurrencia
66
+ page = await context.new_page()
67
+ try:
68
+ await page.goto(url, wait_until="networkidle", timeout=15000)
69
+
70
+ async def safe_text(selector, by="id"):
71
+ try:
72
+ if by == "id":
73
+ return (await page.locator(f"#{selector}").first.inner_text()).strip()
74
+ elif by == "class":
75
+ return (await page.locator(f".{selector}").first.inner_text()).strip()
76
+ except:
77
+ return None
78
+
79
+ # Campos
80
+ fecha = await safe_text("jv-lastModificationDate") or await safe_text("jv-lastModificationDate-no-title")
81
+ data["fecha_publicacion"] = fecha
82
+ data["titulo"] = await safe_text("jv-title")
83
+ data["empresa"] = await safe_text("jv-details-employer-name")
84
+ data["descripcion"] = await safe_text("jv-details-job-description")
85
+ data["pais"] = await safe_text("jv-address-country", by="class")
86
+ data["region"] = await safe_text("jv-address-region", by="class")
87
+ data["duracion_jornada"] = await safe_text("jv-position-schedule-result-0")
88
+ data["tipo_contrato"] = await safe_text("jv-position-type-code-result")
89
+ data["ocupacion"] = await safe_text("jv-job-categories-codes-result-0")
90
+ data["educacion"] = await safe_text("ecl-description-list__definition", by="class")
91
+
92
+ try:
93
+ dia = (await page.locator(".ecl-date-block__day").first.inner_text()).strip()
94
+ mes = (await page.locator(".ecl-date-block__month").first.get_attribute("title")).strip()
95
+ anio = (await page.locator(".ecl-date-block__year").first.inner_text()).strip()
96
+ data["fecha_limite"] = parse_fecha_limite(dia, mes, anio)
97
+ except:
98
+ data["fecha_limite"] = None
99
+
100
+ except PlaywrightTimeoutError:
101
+ print(f"[✗] Timeout: {url}")
102
+ log_fallida(url)
103
+ except Exception as e:
104
+ print(f"[✗] Falló: {url} → {e}")
105
+ log_fallida(url)
106
+ finally:
107
+ await page.close()
108
+
109
+ return data
110
+
111
+ # -------------------------------
112
+ # Main
113
+ # -------------------------------
114
+
115
+ async def main():
116
+ inicio = datetime.now()
117
+ script_dir = os.path.dirname(os.path.abspath(__file__))
118
+ timestamp = datetime.now().strftime("%d_%H%M%S")
119
+ links_path = os.path.join(script_dir, "ofertasFast/pendientes.txt")
120
+ file_path = os.path.join(script_dir, "ofertasFast", f"ofertas{timestamp}.csv")
121
+ leidos_path = os.path.join(script_dir, "ofertasFast", "leidas.txt")
122
+
123
+ sem = asyncio.Semaphore(20) # controla nº de páginas simultáneas
124
+
125
+ async with async_playwright() as p:
126
+ browser = await p.chromium.launch(headless=True)
127
+ context = await browser.new_context()
128
+
129
+ await context.route("**/*", lambda route: route.abort()
130
+ if route.request.resource_type in ["image","stylesheet","font"]
131
+ else route.continue_())
132
+
133
+ for i, urls in enumerate(cargar_urls_por_bloques(links_path, 100, True)):
134
+ print(f"Procesando bloque {i+1} con {len(urls)} URLs")
135
+
136
+ tasks = [scrape_offer(context, clean_language(url), sem) for url in urls]
137
+ resultados = await asyncio.gather(*tasks)
138
+
139
+ for data in resultados:
140
+ if data: # puede ser None si falló
141
+ append_to_csv(data, file_path)
142
+
143
+ with open(leidos_path, "a") as f:
144
+ f.writelines([url + "\n" for url in urls])
145
+
146
+ await browser.close()
147
+
148
+ fin = datetime.now()
149
+ print("Finalizado!")
150
+ print(f"Duración en segundos: {(fin - inicio).total_seconds()}")
151
+
152
+ if __name__ == "__main__":
153
+ asyncio.run(main())
Preprocess.ipynb ADDED
@@ -0,0 +1,1902 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 2,
6
+ "id": "2383b3ff",
7
+ "metadata": {},
8
+ "outputs": [
9
+ {
10
+ "ename": "ModuleNotFoundError",
11
+ "evalue": "No module named 'langdetect'",
12
+ "output_type": "error",
13
+ "traceback": [
14
+ "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
15
+ "\u001b[31mModuleNotFoundError\u001b[39m Traceback (most recent call last)",
16
+ "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[2]\u001b[39m\u001b[32m, line 5\u001b[39m\n\u001b[32m 2\u001b[39m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mdatetime\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m datetime\n\u001b[32m 3\u001b[39m \u001b[38;5;28;01mimport\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mre\u001b[39;00m\n\u001b[32m----> \u001b[39m\u001b[32m5\u001b[39m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mlangdetect\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m detect\n\u001b[32m 6\u001b[39m \u001b[38;5;28;01mimport\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mos\u001b[39;00m\n",
17
+ "\u001b[31mModuleNotFoundError\u001b[39m: No module named 'langdetect'"
18
+ ]
19
+ }
20
+ ],
21
+ "source": [
22
+ "import pandas as pd\n",
23
+ "from datetime import datetime\n",
24
+ "import re\n",
25
+ "\n",
26
+ "from langdetect import detect\n",
27
+ "import os"
28
+ ]
29
+ },
30
+ {
31
+ "cell_type": "markdown",
32
+ "id": "4c94bff5",
33
+ "metadata": {},
34
+ "source": [
35
+ "## Analizamos resultados\n",
36
+ "\n",
37
+ "Vemos que curiosamente la `empresa` y la `duración de jornada` son campos que están vacíos en casi todas las ofertas"
38
+ ]
39
+ },
40
+ {
41
+ "cell_type": "code",
42
+ "execution_count": null,
43
+ "id": "3fa7445a",
44
+ "metadata": {},
45
+ "outputs": [],
46
+ "source": [
47
+ "def read_file(path):\n",
48
+ " df = pd.read_csv(path)#(\"ofertas/ofertas11_092659.csv\")\n",
49
+ " filasNulas = df[df.isna().sum(axis=\"columns\") >= df.shape[1]-1]\n",
50
+ "\n",
51
+ " print(f\"El dataset tiene {df.shape[0]} ofertas, de las cuales, {filasNulas.shape[0]} están vacías (excepto la url)\")\n",
52
+ " print(\"\\nNúmero de nulos por columna, excluyendo filas completamente nulas:\")\n",
53
+ " print(df.isna().sum()[df.isna().sum() > filasNulas.shape[0]] - filasNulas.shape[0])\n",
54
+ "\n",
55
+ " return df, df.drop(filasNulas.index)"
56
+ ]
57
+ },
58
+ {
59
+ "cell_type": "code",
60
+ "execution_count": null,
61
+ "id": "86d881e2",
62
+ "metadata": {},
63
+ "outputs": [],
64
+ "source": [
65
+ "clean = read_file(\"\")"
66
+ ]
67
+ },
68
+ {
69
+ "cell_type": "code",
70
+ "execution_count": 4,
71
+ "id": "ebd41d23",
72
+ "metadata": {},
73
+ "outputs": [
74
+ {
75
+ "data": {
76
+ "text/plain": [
77
+ "array(['11/10/2025', '08/10/2025', '10/10/2025'], dtype=object)"
78
+ ]
79
+ },
80
+ "execution_count": 4,
81
+ "metadata": {},
82
+ "output_type": "execute_result"
83
+ }
84
+ ],
85
+ "source": [
86
+ "clean[\"fecha_publicacion\"].unique()"
87
+ ]
88
+ },
89
+ {
90
+ "cell_type": "code",
91
+ "execution_count": null,
92
+ "id": "8550bf83",
93
+ "metadata": {},
94
+ "outputs": [
95
+ {
96
+ "data": {
97
+ "text/plain": [
98
+ "array(['16/09/2025', '19/11/2025', '15/10/2025', '31/10/2025',\n",
99
+ " '29/10/2025', '16/10/2025', '15/11/2025', '19/10/2025',\n",
100
+ " '21/11/2025', '16/11/2025', '25/10/2025', '30/10/2025',\n",
101
+ " '23/10/2025', '10/10/2025', '11/10/2025', '17/11/2025',\n",
102
+ " '20/10/2025', '18/10/2025', '24/11/2025', '31/12/2025',\n",
103
+ " '22/10/2025', '27/10/2025', '24/10/2025', '21/10/2025',\n",
104
+ " '25/11/2025', '18/11/2025', '20/11/2025', '14/10/2025',\n",
105
+ " '7/11/2025', nan, '11/11/2025', '26/11/2025', '17/10/2025',\n",
106
+ " '26/10/2025', '27/11/2025', '29/11/2025', '1/01/2026',\n",
107
+ " '23/11/2025', '28/11/2025', '29/12/2025', '13/10/2025',\n",
108
+ " '28/10/2025', '26/10/2026', '1/12/2025', '2/11/2025', '30/12/2025',\n",
109
+ " '2/12/2025', '1/11/2025', '3/11/2025', '12/10/2025', '5/12/2025',\n",
110
+ " '3/12/2025', '4/12/2025', '4/11/2025', '30/11/2025', '7/12/2025',\n",
111
+ " '8/12/2025', '11/12/2025', '9/12/2025', '8/11/2025', '10/12/2025',\n",
112
+ " '10/11/2025', '9/11/2025', '6/11/2025', '30/01/2026', '12/12/2025',\n",
113
+ " '13/12/2025', '15/12/2025', '14/11/2025', '16/12/2025',\n",
114
+ " '12/11/2025', '17/12/2025', '18/12/2025', '21/03/2026',\n",
115
+ " '19/12/2025', '14/12/2025', '22/12/2025', '23/12/2025',\n",
116
+ " '21/12/2025', '22/11/2025', '24/12/2025', '25/12/2025',\n",
117
+ " '26/12/2025', '31/10/2026', '2/01/2026', '28/12/2025', '3/01/2026',\n",
118
+ " '5/11/2025', '4/01/2026', '4/03/2026', '5/01/2026', '6/01/2026',\n",
119
+ " '7/01/2026', '6/12/2025', '27/03/2026', '15/01/2026', '15/02/2026',\n",
120
+ " '13/11/2025'], dtype=object)"
121
+ ]
122
+ },
123
+ "execution_count": 5,
124
+ "metadata": {},
125
+ "output_type": "execute_result"
126
+ }
127
+ ],
128
+ "source": [
129
+ "clean[\"fecha_limite\"].unique()"
130
+ ]
131
+ },
132
+ {
133
+ "cell_type": "code",
134
+ "execution_count": 34,
135
+ "id": "af07a3ab",
136
+ "metadata": {},
137
+ "outputs": [
138
+ {
139
+ "data": {
140
+ "text/plain": [
141
+ "((9685, 12), (7435, 12))"
142
+ ]
143
+ },
144
+ "execution_count": 34,
145
+ "metadata": {},
146
+ "output_type": "execute_result"
147
+ }
148
+ ],
149
+ "source": [
150
+ "clean_es = clean[clean['descripcion'].apply(lambda r: detect(r) == 'es')]\n",
151
+ "clean.shape, clean_es.shape"
152
+ ]
153
+ },
154
+ {
155
+ "cell_type": "code",
156
+ "execution_count": 35,
157
+ "id": "b2a64e2e",
158
+ "metadata": {},
159
+ "outputs": [],
160
+ "source": [
161
+ "clean_es.to_csv(\"ofertasRaw.csv\")"
162
+ ]
163
+ },
164
+ {
165
+ "cell_type": "markdown",
166
+ "id": "eaa470d2",
167
+ "metadata": {},
168
+ "source": [
169
+ "## Gestionar valores duplicados y NaN"
170
+ ]
171
+ },
172
+ {
173
+ "cell_type": "code",
174
+ "execution_count": 17,
175
+ "id": "c67fd09c",
176
+ "metadata": {},
177
+ "outputs": [
178
+ {
179
+ "data": {
180
+ "text/plain": [
181
+ "np.int64(0)"
182
+ ]
183
+ },
184
+ "execution_count": 17,
185
+ "metadata": {},
186
+ "output_type": "execute_result"
187
+ }
188
+ ],
189
+ "source": [
190
+ "clean = pd.read_csv(\"ofertasRaw.csv\").drop([\"Unnamed: 0\"], axis=\"columns\")\n",
191
+ "clean.drop_duplicates(subset=['url'], inplace=True)\n",
192
+ "clean.duplicated().sum()"
193
+ ]
194
+ },
195
+ {
196
+ "cell_type": "code",
197
+ "execution_count": 18,
198
+ "id": "454cb0ba",
199
+ "metadata": {},
200
+ "outputs": [
201
+ {
202
+ "data": {
203
+ "text/html": [
204
+ "<div>\n",
205
+ "<style scoped>\n",
206
+ " .dataframe tbody tr th:only-of-type {\n",
207
+ " vertical-align: middle;\n",
208
+ " }\n",
209
+ "\n",
210
+ " .dataframe tbody tr th {\n",
211
+ " vertical-align: top;\n",
212
+ " }\n",
213
+ "\n",
214
+ " .dataframe thead th {\n",
215
+ " text-align: right;\n",
216
+ " }\n",
217
+ "</style>\n",
218
+ "<table border=\"1\" class=\"dataframe\">\n",
219
+ " <thead>\n",
220
+ " <tr style=\"text-align: right;\">\n",
221
+ " <th></th>\n",
222
+ " <th>fecha_publicacion</th>\n",
223
+ " <th>fecha_limite</th>\n",
224
+ " <th>titulo</th>\n",
225
+ " <th>empresa</th>\n",
226
+ " <th>ocupacion</th>\n",
227
+ " <th>educacion</th>\n",
228
+ " <th>descripcion</th>\n",
229
+ " <th>pais</th>\n",
230
+ " <th>region</th>\n",
231
+ " <th>duracion_jornada</th>\n",
232
+ " <th>tipo_contrato</th>\n",
233
+ " </tr>\n",
234
+ " <tr>\n",
235
+ " <th>url</th>\n",
236
+ " <th></th>\n",
237
+ " <th></th>\n",
238
+ " <th></th>\n",
239
+ " <th></th>\n",
240
+ " <th></th>\n",
241
+ " <th></th>\n",
242
+ " <th></th>\n",
243
+ " <th></th>\n",
244
+ " <th></th>\n",
245
+ " <th></th>\n",
246
+ " <th></th>\n",
247
+ " </tr>\n",
248
+ " </thead>\n",
249
+ " <tbody>\n",
250
+ " <tr>\n",
251
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzE4NDAzMCAxMDI?lang=es</th>\n",
252
+ " <td>10/10/2025</td>\n",
253
+ " <td>31/10/2025</td>\n",
254
+ " <td>CONDUCTORES DE CAMIÓN, EN GENERAL</td>\n",
255
+ " <td>NaN</td>\n",
256
+ " <td>Conductor de vehículo de carga/conductora de v...</td>\n",
257
+ " <td>Contrato</td>\n",
258
+ " <td>REQUIERE ESTAR EN POSESIÓN DEL CAP. LA EMPRESA...</td>\n",
259
+ " <td>España</td>\n",
260
+ " <td>Palencia -</td>\n",
261
+ " <td>NaN</td>\n",
262
+ " <td>Contrato</td>\n",
263
+ " </tr>\n",
264
+ " <tr>\n",
265
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzIyMDEwMCAxMDI?lang=es</th>\n",
266
+ " <td>10/10/2025</td>\n",
267
+ " <td>10/10/2025</td>\n",
268
+ " <td>WORK/LOCATION</td>\n",
269
+ " <td>NaN</td>\n",
270
+ " <td>Empleado administrativo de archivos/empleada a...</td>\n",
271
+ " <td>Contrato</td>\n",
272
+ " <td>ES BUSCA UNA PERSONA AMB ESTUDIS I EXPERIèNCIA...</td>\n",
273
+ " <td>España</td>\n",
274
+ " <td>Tarragona -</td>\n",
275
+ " <td>NaN</td>\n",
276
+ " <td>Contrato</td>\n",
277
+ " </tr>\n",
278
+ " <tr>\n",
279
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzIyNzY1MCAxMDI?lang=es</th>\n",
280
+ " <td>10/10/2025</td>\n",
281
+ " <td>24/10/2025</td>\n",
282
+ " <td>WORK/LOCATION</td>\n",
283
+ " <td>NaN</td>\n",
284
+ " <td>Operario especializado en engranajes de automo...</td>\n",
285
+ " <td>Contrato</td>\n",
286
+ " <td>CERQUEM PROFESSIONALS AMB EXPERIèNCIA EN MUNTA...</td>\n",
287
+ " <td>España</td>\n",
288
+ " <td>Girona -</td>\n",
289
+ " <td>NaN</td>\n",
290
+ " <td>Contrato</td>\n",
291
+ " </tr>\n",
292
+ " <tr>\n",
293
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzIyMDg4OSAxMDI?lang=es</th>\n",
294
+ " <td>10/10/2025</td>\n",
295
+ " <td>13/10/2025</td>\n",
296
+ " <td>WORK/LOCATION</td>\n",
297
+ " <td>NaN</td>\n",
298
+ " <td>Empleado del hogar/empleada del hogar</td>\n",
299
+ " <td>Contrato</td>\n",
300
+ " <td>IMPORTANTE EMPRESA UBICADA EN MERCABARNA PRECI...</td>\n",
301
+ " <td>España</td>\n",
302
+ " <td>Barcelona -</td>\n",
303
+ " <td>NaN</td>\n",
304
+ " <td>Contrato</td>\n",
305
+ " </tr>\n",
306
+ " <tr>\n",
307
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzIyNDgzOSAxMDI?lang=es</th>\n",
308
+ " <td>10/10/2025</td>\n",
309
+ " <td>20/10/2025</td>\n",
310
+ " <td>WORK/LOCATION</td>\n",
311
+ " <td>NaN</td>\n",
312
+ " <td>Conductor de servicios de transporte de enferm...</td>\n",
313
+ " <td>Determinado</td>\n",
314
+ " <td>REQUISITS: ? TITULACIÓ D? ESPECIALISTA EN FARM...</td>\n",
315
+ " <td>España</td>\n",
316
+ " <td>Barcelona -</td>\n",
317
+ " <td>NaN</td>\n",
318
+ " <td>Determinado</td>\n",
319
+ " </tr>\n",
320
+ " <tr>\n",
321
+ " <th>...</th>\n",
322
+ " <td>...</td>\n",
323
+ " <td>...</td>\n",
324
+ " <td>...</td>\n",
325
+ " <td>...</td>\n",
326
+ " <td>...</td>\n",
327
+ " <td>...</td>\n",
328
+ " <td>...</td>\n",
329
+ " <td>...</td>\n",
330
+ " <td>...</td>\n",
331
+ " <td>...</td>\n",
332
+ " <td>...</td>\n",
333
+ " </tr>\n",
334
+ " <tr>\n",
335
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzIzOTcwNyAxMDI?lang=es</th>\n",
336
+ " <td>11/10/2025</td>\n",
337
+ " <td>20/11/2025</td>\n",
338
+ " <td>WORK/LOCATION</td>\n",
339
+ " <td>NaN</td>\n",
340
+ " <td>Inspector de carga y flete/inspectora de carga...</td>\n",
341
+ " <td>Determinado</td>\n",
342
+ " <td>ACTUALMENTE, DESDE LA DELEGACIÓN DE TARRAGONA ...</td>\n",
343
+ " <td>España</td>\n",
344
+ " <td>Barcelona -</td>\n",
345
+ " <td>NaN</td>\n",
346
+ " <td>Determinado</td>\n",
347
+ " </tr>\n",
348
+ " <tr>\n",
349
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzIzOTcxNiAxMDI?lang=es</th>\n",
350
+ " <td>11/10/2025</td>\n",
351
+ " <td>20/11/2025</td>\n",
352
+ " <td>WORK/LOCATION</td>\n",
353
+ " <td>NaN</td>\n",
354
+ " <td>Profesor de autoescuela/profesora de autoescuela</td>\n",
355
+ " <td>Autónomo</td>\n",
356
+ " <td>NDICE CONSULTORÍA Y FORMACIÓN, SOMOS UNA CONSU...</td>\n",
357
+ " <td>España</td>\n",
358
+ " <td>Barcelona -</td>\n",
359
+ " <td>NaN</td>\n",
360
+ " <td>Autónomo</td>\n",
361
+ " </tr>\n",
362
+ " <tr>\n",
363
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzIzOTczMiAxMDI?lang=es</th>\n",
364
+ " <td>11/10/2025</td>\n",
365
+ " <td>20/11/2025</td>\n",
366
+ " <td>WORK/LOCATION</td>\n",
367
+ " <td>NaN</td>\n",
368
+ " <td>Mayordomo del servicio doméstico</td>\n",
369
+ " <td>Contrato</td>\n",
370
+ " <td>HELPOINT -ÉS UNA CONSULTORIA ÚNICA ESPECIALITZ...</td>\n",
371
+ " <td>España</td>\n",
372
+ " <td>Barcelona -</td>\n",
373
+ " <td>NaN</td>\n",
374
+ " <td>Contrato</td>\n",
375
+ " </tr>\n",
376
+ " <tr>\n",
377
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzIzOTczNSAxMDI?lang=es</th>\n",
378
+ " <td>10/10/2025</td>\n",
379
+ " <td>22/10/2025</td>\n",
380
+ " <td>MONITOR/A ROBÓTICA EDUCATIVA - LLANES Y CANGAS...</td>\n",
381
+ " <td>NaN</td>\n",
382
+ " <td>Maestro de educación primaria/maestra de educa...</td>\n",
383
+ " <td>Determinado</td>\n",
384
+ " <td>FUNCIONES: Preparar actividades y proyectos di...</td>\n",
385
+ " <td>España</td>\n",
386
+ " <td>Asturias -</td>\n",
387
+ " <td>NaN</td>\n",
388
+ " <td>Determinado</td>\n",
389
+ " </tr>\n",
390
+ " <tr>\n",
391
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzIzOTgzOCAxMDI?lang=es</th>\n",
392
+ " <td>11/10/2025</td>\n",
393
+ " <td>13/10/2025</td>\n",
394
+ " <td>DOCENTE PARA IMPARTIR CURSO</td>\n",
395
+ " <td>NaN</td>\n",
396
+ " <td>NaN</td>\n",
397
+ " <td>Determinado</td>\n",
398
+ " <td>IMPARTIR MÓDULOS: - OFIMÁTICA - INICIACIÓN A I...</td>\n",
399
+ " <td>España</td>\n",
400
+ " <td>Albacete -</td>\n",
401
+ " <td>NaN</td>\n",
402
+ " <td>Determinado</td>\n",
403
+ " </tr>\n",
404
+ " </tbody>\n",
405
+ "</table>\n",
406
+ "<p>7305 rows × 11 columns</p>\n",
407
+ "</div>"
408
+ ],
409
+ "text/plain": [
410
+ " fecha_publicacion \\\n",
411
+ "url \n",
412
+ "https://europa.eu/eures/portal/jv-se/jv-details... 10/10/2025 \n",
413
+ "https://europa.eu/eures/portal/jv-se/jv-details... 10/10/2025 \n",
414
+ "https://europa.eu/eures/portal/jv-se/jv-details... 10/10/2025 \n",
415
+ "https://europa.eu/eures/portal/jv-se/jv-details... 10/10/2025 \n",
416
+ "https://europa.eu/eures/portal/jv-se/jv-details... 10/10/2025 \n",
417
+ "... ... \n",
418
+ "https://europa.eu/eures/portal/jv-se/jv-details... 11/10/2025 \n",
419
+ "https://europa.eu/eures/portal/jv-se/jv-details... 11/10/2025 \n",
420
+ "https://europa.eu/eures/portal/jv-se/jv-details... 11/10/2025 \n",
421
+ "https://europa.eu/eures/portal/jv-se/jv-details... 10/10/2025 \n",
422
+ "https://europa.eu/eures/portal/jv-se/jv-details... 11/10/2025 \n",
423
+ "\n",
424
+ " fecha_limite \\\n",
425
+ "url \n",
426
+ "https://europa.eu/eures/portal/jv-se/jv-details... 31/10/2025 \n",
427
+ "https://europa.eu/eures/portal/jv-se/jv-details... 10/10/2025 \n",
428
+ "https://europa.eu/eures/portal/jv-se/jv-details... 24/10/2025 \n",
429
+ "https://europa.eu/eures/portal/jv-se/jv-details... 13/10/2025 \n",
430
+ "https://europa.eu/eures/portal/jv-se/jv-details... 20/10/2025 \n",
431
+ "... ... \n",
432
+ "https://europa.eu/eures/portal/jv-se/jv-details... 20/11/2025 \n",
433
+ "https://europa.eu/eures/portal/jv-se/jv-details... 20/11/2025 \n",
434
+ "https://europa.eu/eures/portal/jv-se/jv-details... 20/11/2025 \n",
435
+ "https://europa.eu/eures/portal/jv-se/jv-details... 22/10/2025 \n",
436
+ "https://europa.eu/eures/portal/jv-se/jv-details... 13/10/2025 \n",
437
+ "\n",
438
+ " titulo \\\n",
439
+ "url \n",
440
+ "https://europa.eu/eures/portal/jv-se/jv-details... CONDUCTORES DE CAMIÓN, EN GENERAL \n",
441
+ "https://europa.eu/eures/portal/jv-se/jv-details... WORK/LOCATION \n",
442
+ "https://europa.eu/eures/portal/jv-se/jv-details... WORK/LOCATION \n",
443
+ "https://europa.eu/eures/portal/jv-se/jv-details... WORK/LOCATION \n",
444
+ "https://europa.eu/eures/portal/jv-se/jv-details... WORK/LOCATION \n",
445
+ "... ... \n",
446
+ "https://europa.eu/eures/portal/jv-se/jv-details... WORK/LOCATION \n",
447
+ "https://europa.eu/eures/portal/jv-se/jv-details... WORK/LOCATION \n",
448
+ "https://europa.eu/eures/portal/jv-se/jv-details... WORK/LOCATION \n",
449
+ "https://europa.eu/eures/portal/jv-se/jv-details... MONITOR/A ROBÓTICA EDUCATIVA - LLANES Y CANGAS... \n",
450
+ "https://europa.eu/eures/portal/jv-se/jv-details... DOCENTE PARA IMPARTIR CURSO \n",
451
+ "\n",
452
+ " empresa \\\n",
453
+ "url \n",
454
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
455
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
456
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
457
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
458
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
459
+ "... ... \n",
460
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
461
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
462
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
463
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
464
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
465
+ "\n",
466
+ " ocupacion \\\n",
467
+ "url \n",
468
+ "https://europa.eu/eures/portal/jv-se/jv-details... Conductor de vehículo de carga/conductora de v... \n",
469
+ "https://europa.eu/eures/portal/jv-se/jv-details... Empleado administrativo de archivos/empleada a... \n",
470
+ "https://europa.eu/eures/portal/jv-se/jv-details... Operario especializado en engranajes de automo... \n",
471
+ "https://europa.eu/eures/portal/jv-se/jv-details... Empleado del hogar/empleada del hogar \n",
472
+ "https://europa.eu/eures/portal/jv-se/jv-details... Conductor de servicios de transporte de enferm... \n",
473
+ "... ... \n",
474
+ "https://europa.eu/eures/portal/jv-se/jv-details... Inspector de carga y flete/inspectora de carga... \n",
475
+ "https://europa.eu/eures/portal/jv-se/jv-details... Profesor de autoescuela/profesora de autoescuela \n",
476
+ "https://europa.eu/eures/portal/jv-se/jv-details... Mayordomo del servicio doméstico \n",
477
+ "https://europa.eu/eures/portal/jv-se/jv-details... Maestro de educación primaria/maestra de educa... \n",
478
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
479
+ "\n",
480
+ " educacion \\\n",
481
+ "url \n",
482
+ "https://europa.eu/eures/portal/jv-se/jv-details... Contrato \n",
483
+ "https://europa.eu/eures/portal/jv-se/jv-details... Contrato \n",
484
+ "https://europa.eu/eures/portal/jv-se/jv-details... Contrato \n",
485
+ "https://europa.eu/eures/portal/jv-se/jv-details... Contrato \n",
486
+ "https://europa.eu/eures/portal/jv-se/jv-details... Determinado \n",
487
+ "... ... \n",
488
+ "https://europa.eu/eures/portal/jv-se/jv-details... Determinado \n",
489
+ "https://europa.eu/eures/portal/jv-se/jv-details... Autónomo \n",
490
+ "https://europa.eu/eures/portal/jv-se/jv-details... Contrato \n",
491
+ "https://europa.eu/eures/portal/jv-se/jv-details... Determinado \n",
492
+ "https://europa.eu/eures/portal/jv-se/jv-details... Determinado \n",
493
+ "\n",
494
+ " descripcion \\\n",
495
+ "url \n",
496
+ "https://europa.eu/eures/portal/jv-se/jv-details... REQUIERE ESTAR EN POSESIÓN DEL CAP. LA EMPRESA... \n",
497
+ "https://europa.eu/eures/portal/jv-se/jv-details... ES BUSCA UNA PERSONA AMB ESTUDIS I EXPERIèNCIA... \n",
498
+ "https://europa.eu/eures/portal/jv-se/jv-details... CERQUEM PROFESSIONALS AMB EXPERIèNCIA EN MUNTA... \n",
499
+ "https://europa.eu/eures/portal/jv-se/jv-details... IMPORTANTE EMPRESA UBICADA EN MERCABARNA PRECI... \n",
500
+ "https://europa.eu/eures/portal/jv-se/jv-details... REQUISITS: ? TITULACIÓ D? ESPECIALISTA EN FARM... \n",
501
+ "... ... \n",
502
+ "https://europa.eu/eures/portal/jv-se/jv-details... ACTUALMENTE, DESDE LA DELEGACIÓN DE TARRAGONA ... \n",
503
+ "https://europa.eu/eures/portal/jv-se/jv-details... NDICE CONSULTORÍA Y FORMACIÓN, SOMOS UNA CONSU... \n",
504
+ "https://europa.eu/eures/portal/jv-se/jv-details... HELPOINT -ÉS UNA CONSULTORIA ÚNICA ESPECIALITZ... \n",
505
+ "https://europa.eu/eures/portal/jv-se/jv-details... FUNCIONES: Preparar actividades y proyectos di... \n",
506
+ "https://europa.eu/eures/portal/jv-se/jv-details... IMPARTIR MÓDULOS: - OFIMÁTICA - INICIACIÓN A I... \n",
507
+ "\n",
508
+ " pais region \\\n",
509
+ "url \n",
510
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Palencia - \n",
511
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Tarragona - \n",
512
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Girona - \n",
513
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Barcelona - \n",
514
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Barcelona - \n",
515
+ "... ... ... \n",
516
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Barcelona - \n",
517
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Barcelona - \n",
518
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Barcelona - \n",
519
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Asturias - \n",
520
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Albacete - \n",
521
+ "\n",
522
+ " duracion_jornada \\\n",
523
+ "url \n",
524
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
525
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
526
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
527
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
528
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
529
+ "... ... \n",
530
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
531
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
532
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
533
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
534
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
535
+ "\n",
536
+ " tipo_contrato \n",
537
+ "url \n",
538
+ "https://europa.eu/eures/portal/jv-se/jv-details... Contrato \n",
539
+ "https://europa.eu/eures/portal/jv-se/jv-details... Contrato \n",
540
+ "https://europa.eu/eures/portal/jv-se/jv-details... Contrato \n",
541
+ "https://europa.eu/eures/portal/jv-se/jv-details... Contrato \n",
542
+ "https://europa.eu/eures/portal/jv-se/jv-details... Determinado \n",
543
+ "... ... \n",
544
+ "https://europa.eu/eures/portal/jv-se/jv-details... Determinado \n",
545
+ "https://europa.eu/eures/portal/jv-se/jv-details... Autónomo \n",
546
+ "https://europa.eu/eures/portal/jv-se/jv-details... Contrato \n",
547
+ "https://europa.eu/eures/portal/jv-se/jv-details... Determinado \n",
548
+ "https://europa.eu/eures/portal/jv-se/jv-details... Determinado \n",
549
+ "\n",
550
+ "[7305 rows x 11 columns]"
551
+ ]
552
+ },
553
+ "execution_count": 18,
554
+ "metadata": {},
555
+ "output_type": "execute_result"
556
+ }
557
+ ],
558
+ "source": [
559
+ "clean.set_index(\"url\")"
560
+ ]
561
+ },
562
+ {
563
+ "cell_type": "code",
564
+ "execution_count": 19,
565
+ "id": "252a049e",
566
+ "metadata": {},
567
+ "outputs": [
568
+ {
569
+ "data": {
570
+ "text/plain": [
571
+ "url 0\n",
572
+ "fecha_publicacion 0\n",
573
+ "fecha_limite 6\n",
574
+ "titulo 0\n",
575
+ "empresa 7241\n",
576
+ "ocupacion 735\n",
577
+ "educacion 0\n",
578
+ "descripcion 0\n",
579
+ "pais 0\n",
580
+ "region 115\n",
581
+ "duracion_jornada 7305\n",
582
+ "tipo_contrato 2\n",
583
+ "dtype: int64"
584
+ ]
585
+ },
586
+ "execution_count": 19,
587
+ "metadata": {},
588
+ "output_type": "execute_result"
589
+ }
590
+ ],
591
+ "source": [
592
+ "clean.isna().sum()"
593
+ ]
594
+ },
595
+ {
596
+ "cell_type": "markdown",
597
+ "id": "ccb1d66f",
598
+ "metadata": {},
599
+ "source": [
600
+ "Hay que borrar filas de fecha nula"
601
+ ]
602
+ },
603
+ {
604
+ "cell_type": "code",
605
+ "execution_count": 20,
606
+ "id": "5c8420b0",
607
+ "metadata": {},
608
+ "outputs": [],
609
+ "source": [
610
+ "clean.dropna(subset=\"fecha_limite\", inplace=True)"
611
+ ]
612
+ },
613
+ {
614
+ "cell_type": "code",
615
+ "execution_count": 21,
616
+ "id": "cda7e3ff",
617
+ "metadata": {},
618
+ "outputs": [],
619
+ "source": [
620
+ "def cleanDash(region):\n",
621
+ " if type(region) == str:\n",
622
+ " if region[-1] == \"-\":\n",
623
+ " region = region[:-1]\n",
624
+ " return region.strip()\n",
625
+ " return region\n",
626
+ "\n",
627
+ "clean[\"region\"] = clean[\"region\"].apply(cleanDash)"
628
+ ]
629
+ },
630
+ {
631
+ "cell_type": "code",
632
+ "execution_count": 22,
633
+ "id": "33b6c70a",
634
+ "metadata": {},
635
+ "outputs": [
636
+ {
637
+ "data": {
638
+ "text/html": [
639
+ "<div>\n",
640
+ "<style scoped>\n",
641
+ " .dataframe tbody tr th:only-of-type {\n",
642
+ " vertical-align: middle;\n",
643
+ " }\n",
644
+ "\n",
645
+ " .dataframe tbody tr th {\n",
646
+ " vertical-align: top;\n",
647
+ " }\n",
648
+ "\n",
649
+ " .dataframe thead th {\n",
650
+ " text-align: right;\n",
651
+ " }\n",
652
+ "</style>\n",
653
+ "<table border=\"1\" class=\"dataframe\">\n",
654
+ " <thead>\n",
655
+ " <tr style=\"text-align: right;\">\n",
656
+ " <th></th>\n",
657
+ " <th>url</th>\n",
658
+ " <th>fecha_publicacion</th>\n",
659
+ " <th>fecha_limite</th>\n",
660
+ " <th>titulo</th>\n",
661
+ " <th>empresa</th>\n",
662
+ " <th>ocupacion</th>\n",
663
+ " <th>educacion</th>\n",
664
+ " <th>descripcion</th>\n",
665
+ " <th>pais</th>\n",
666
+ " <th>region</th>\n",
667
+ " <th>duracion_jornada</th>\n",
668
+ " <th>tipo_contrato</th>\n",
669
+ " </tr>\n",
670
+ " </thead>\n",
671
+ " <tbody>\n",
672
+ " <tr>\n",
673
+ " <th>0</th>\n",
674
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
675
+ " <td>10/10/2025</td>\n",
676
+ " <td>31/10/2025</td>\n",
677
+ " <td>CONDUCTORES DE CAMIÓN, EN GENERAL</td>\n",
678
+ " <td>NaN</td>\n",
679
+ " <td>Conductor de vehículo de carga/conductora de v...</td>\n",
680
+ " <td>Contrato</td>\n",
681
+ " <td>REQUIERE ESTAR EN POSESIÓN DEL CAP. LA EMPRESA...</td>\n",
682
+ " <td>España</td>\n",
683
+ " <td>Palencia</td>\n",
684
+ " <td>NaN</td>\n",
685
+ " <td>Contrato</td>\n",
686
+ " </tr>\n",
687
+ " <tr>\n",
688
+ " <th>1</th>\n",
689
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
690
+ " <td>10/10/2025</td>\n",
691
+ " <td>10/10/2025</td>\n",
692
+ " <td>WORK/LOCATION</td>\n",
693
+ " <td>NaN</td>\n",
694
+ " <td>Empleado administrativo de archivos/empleada a...</td>\n",
695
+ " <td>Contrato</td>\n",
696
+ " <td>ES BUSCA UNA PERSONA AMB ESTUDIS I EXPERIèNCIA...</td>\n",
697
+ " <td>España</td>\n",
698
+ " <td>Tarragona</td>\n",
699
+ " <td>NaN</td>\n",
700
+ " <td>Contrato</td>\n",
701
+ " </tr>\n",
702
+ " <tr>\n",
703
+ " <th>2</th>\n",
704
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
705
+ " <td>10/10/2025</td>\n",
706
+ " <td>24/10/2025</td>\n",
707
+ " <td>WORK/LOCATION</td>\n",
708
+ " <td>NaN</td>\n",
709
+ " <td>Operario especializado en engranajes de automo...</td>\n",
710
+ " <td>Contrato</td>\n",
711
+ " <td>CERQUEM PROFESSIONALS AMB EXPERIèNCIA EN MUNTA...</td>\n",
712
+ " <td>España</td>\n",
713
+ " <td>Girona</td>\n",
714
+ " <td>NaN</td>\n",
715
+ " <td>Contrato</td>\n",
716
+ " </tr>\n",
717
+ " <tr>\n",
718
+ " <th>3</th>\n",
719
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
720
+ " <td>10/10/2025</td>\n",
721
+ " <td>13/10/2025</td>\n",
722
+ " <td>WORK/LOCATION</td>\n",
723
+ " <td>NaN</td>\n",
724
+ " <td>Empleado del hogar/empleada del hogar</td>\n",
725
+ " <td>Contrato</td>\n",
726
+ " <td>IMPORTANTE EMPRESA UBICADA EN MERCABARNA PRECI...</td>\n",
727
+ " <td>España</td>\n",
728
+ " <td>Barcelona</td>\n",
729
+ " <td>NaN</td>\n",
730
+ " <td>Contrato</td>\n",
731
+ " </tr>\n",
732
+ " <tr>\n",
733
+ " <th>4</th>\n",
734
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
735
+ " <td>10/10/2025</td>\n",
736
+ " <td>20/10/2025</td>\n",
737
+ " <td>WORK/LOCATION</td>\n",
738
+ " <td>NaN</td>\n",
739
+ " <td>Conductor de servicios de transporte de enferm...</td>\n",
740
+ " <td>Determinado</td>\n",
741
+ " <td>REQUISITS: ? TITULACIÓ D? ESPECIALISTA EN FARM...</td>\n",
742
+ " <td>España</td>\n",
743
+ " <td>Barcelona</td>\n",
744
+ " <td>NaN</td>\n",
745
+ " <td>Determinado</td>\n",
746
+ " </tr>\n",
747
+ " </tbody>\n",
748
+ "</table>\n",
749
+ "</div>"
750
+ ],
751
+ "text/plain": [
752
+ " url fecha_publicacion \\\n",
753
+ "0 https://europa.eu/eures/portal/jv-se/jv-detail... 10/10/2025 \n",
754
+ "1 https://europa.eu/eures/portal/jv-se/jv-detail... 10/10/2025 \n",
755
+ "2 https://europa.eu/eures/portal/jv-se/jv-detail... 10/10/2025 \n",
756
+ "3 https://europa.eu/eures/portal/jv-se/jv-detail... 10/10/2025 \n",
757
+ "4 https://europa.eu/eures/portal/jv-se/jv-detail... 10/10/2025 \n",
758
+ "\n",
759
+ " fecha_limite titulo empresa \\\n",
760
+ "0 31/10/2025 CONDUCTORES DE CAMIÓN, EN GENERAL NaN \n",
761
+ "1 10/10/2025 WORK/LOCATION NaN \n",
762
+ "2 24/10/2025 WORK/LOCATION NaN \n",
763
+ "3 13/10/2025 WORK/LOCATION NaN \n",
764
+ "4 20/10/2025 WORK/LOCATION NaN \n",
765
+ "\n",
766
+ " ocupacion educacion \\\n",
767
+ "0 Conductor de vehículo de carga/conductora de v... Contrato \n",
768
+ "1 Empleado administrativo de archivos/empleada a... Contrato \n",
769
+ "2 Operario especializado en engranajes de automo... Contrato \n",
770
+ "3 Empleado del hogar/empleada del hogar Contrato \n",
771
+ "4 Conductor de servicios de transporte de enferm... Determinado \n",
772
+ "\n",
773
+ " descripcion pais region \\\n",
774
+ "0 REQUIERE ESTAR EN POSESIÓN DEL CAP. LA EMPRESA... España Palencia \n",
775
+ "1 ES BUSCA UNA PERSONA AMB ESTUDIS I EXPERIèNCIA... España Tarragona \n",
776
+ "2 CERQUEM PROFESSIONALS AMB EXPERIèNCIA EN MUNTA... España Girona \n",
777
+ "3 IMPORTANTE EMPRESA UBICADA EN MERCABARNA PRECI... España Barcelona \n",
778
+ "4 REQUISITS: ? TITULACIÓ D? ESPECIALISTA EN FARM... España Barcelona \n",
779
+ "\n",
780
+ " duracion_jornada tipo_contrato \n",
781
+ "0 NaN Contrato \n",
782
+ "1 NaN Contrato \n",
783
+ "2 NaN Contrato \n",
784
+ "3 NaN Contrato \n",
785
+ "4 NaN Determinado "
786
+ ]
787
+ },
788
+ "execution_count": 22,
789
+ "metadata": {},
790
+ "output_type": "execute_result"
791
+ }
792
+ ],
793
+ "source": [
794
+ "clean.head()"
795
+ ]
796
+ },
797
+ {
798
+ "cell_type": "markdown",
799
+ "id": "52591110",
800
+ "metadata": {},
801
+ "source": [
802
+ "### Columnas sin informacion"
803
+ ]
804
+ },
805
+ {
806
+ "cell_type": "code",
807
+ "execution_count": null,
808
+ "id": "10494817",
809
+ "metadata": {},
810
+ "outputs": [
811
+ {
812
+ "data": {
813
+ "text/plain": [
814
+ "(7299, 9)"
815
+ ]
816
+ },
817
+ "execution_count": 23,
818
+ "metadata": {},
819
+ "output_type": "execute_result"
820
+ }
821
+ ],
822
+ "source": [
823
+ "clean.set_index(\"url\", inplace= True)\n",
824
+ "clean.drop([\"educacion\", \"duracion_jornada\", \"empresa\"], inplace= True, axis=\"columns\")\n",
825
+ "clean.shape"
826
+ ]
827
+ },
828
+ {
829
+ "cell_type": "code",
830
+ "execution_count": 24,
831
+ "id": "7dcf3049",
832
+ "metadata": {},
833
+ "outputs": [
834
+ {
835
+ "data": {
836
+ "text/html": [
837
+ "<div>\n",
838
+ "<style scoped>\n",
839
+ " .dataframe tbody tr th:only-of-type {\n",
840
+ " vertical-align: middle;\n",
841
+ " }\n",
842
+ "\n",
843
+ " .dataframe tbody tr th {\n",
844
+ " vertical-align: top;\n",
845
+ " }\n",
846
+ "\n",
847
+ " .dataframe thead th {\n",
848
+ " text-align: right;\n",
849
+ " }\n",
850
+ "</style>\n",
851
+ "<table border=\"1\" class=\"dataframe\">\n",
852
+ " <thead>\n",
853
+ " <tr style=\"text-align: right;\">\n",
854
+ " <th></th>\n",
855
+ " <th>fecha_publicacion</th>\n",
856
+ " <th>fecha_limite</th>\n",
857
+ " <th>titulo</th>\n",
858
+ " <th>empresa</th>\n",
859
+ " <th>ocupacion</th>\n",
860
+ " <th>descripcion</th>\n",
861
+ " <th>pais</th>\n",
862
+ " <th>region</th>\n",
863
+ " <th>tipo_contrato</th>\n",
864
+ " </tr>\n",
865
+ " <tr>\n",
866
+ " <th>url</th>\n",
867
+ " <th></th>\n",
868
+ " <th></th>\n",
869
+ " <th></th>\n",
870
+ " <th></th>\n",
871
+ " <th></th>\n",
872
+ " <th></th>\n",
873
+ " <th></th>\n",
874
+ " <th></th>\n",
875
+ " <th></th>\n",
876
+ " </tr>\n",
877
+ " </thead>\n",
878
+ " <tbody>\n",
879
+ " <tr>\n",
880
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzE4NDAzMCAxMDI?lang=es</th>\n",
881
+ " <td>10/10/2025</td>\n",
882
+ " <td>31/10/2025</td>\n",
883
+ " <td>CONDUCTORES DE CAMIÓN, EN GENERAL</td>\n",
884
+ " <td>NaN</td>\n",
885
+ " <td>Conductor de vehículo de carga/conductora de v...</td>\n",
886
+ " <td>REQUIERE ESTAR EN POSESIÓN DEL CAP. LA EMPRESA...</td>\n",
887
+ " <td>España</td>\n",
888
+ " <td>Palencia</td>\n",
889
+ " <td>Contrato</td>\n",
890
+ " </tr>\n",
891
+ " <tr>\n",
892
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzIyMDEwMCAxMDI?lang=es</th>\n",
893
+ " <td>10/10/2025</td>\n",
894
+ " <td>10/10/2025</td>\n",
895
+ " <td>WORK/LOCATION</td>\n",
896
+ " <td>NaN</td>\n",
897
+ " <td>Empleado administrativo de archivos/empleada a...</td>\n",
898
+ " <td>ES BUSCA UNA PERSONA AMB ESTUDIS I EXPERIèNCIA...</td>\n",
899
+ " <td>España</td>\n",
900
+ " <td>Tarragona</td>\n",
901
+ " <td>Contrato</td>\n",
902
+ " </tr>\n",
903
+ " <tr>\n",
904
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzIyNzY1MCAxMDI?lang=es</th>\n",
905
+ " <td>10/10/2025</td>\n",
906
+ " <td>24/10/2025</td>\n",
907
+ " <td>WORK/LOCATION</td>\n",
908
+ " <td>NaN</td>\n",
909
+ " <td>Operario especializado en engranajes de automo...</td>\n",
910
+ " <td>CERQUEM PROFESSIONALS AMB EXPERIèNCIA EN MUNTA...</td>\n",
911
+ " <td>España</td>\n",
912
+ " <td>Girona</td>\n",
913
+ " <td>Contrato</td>\n",
914
+ " </tr>\n",
915
+ " <tr>\n",
916
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzIyMDg4OSAxMDI?lang=es</th>\n",
917
+ " <td>10/10/2025</td>\n",
918
+ " <td>13/10/2025</td>\n",
919
+ " <td>WORK/LOCATION</td>\n",
920
+ " <td>NaN</td>\n",
921
+ " <td>Empleado del hogar/empleada del hogar</td>\n",
922
+ " <td>IMPORTANTE EMPRESA UBICADA EN MERCABARNA PRECI...</td>\n",
923
+ " <td>España</td>\n",
924
+ " <td>Barcelona</td>\n",
925
+ " <td>Contrato</td>\n",
926
+ " </tr>\n",
927
+ " <tr>\n",
928
+ " <th>https://europa.eu/eures/portal/jv-se/jv-details/NzIyNDgzOSAxMDI?lang=es</th>\n",
929
+ " <td>10/10/2025</td>\n",
930
+ " <td>20/10/2025</td>\n",
931
+ " <td>WORK/LOCATION</td>\n",
932
+ " <td>NaN</td>\n",
933
+ " <td>Conductor de servicios de transporte de enferm...</td>\n",
934
+ " <td>REQUISITS: ? TITULACIÓ D? ESPECIALISTA EN FARM...</td>\n",
935
+ " <td>España</td>\n",
936
+ " <td>Barcelona</td>\n",
937
+ " <td>Determinado</td>\n",
938
+ " </tr>\n",
939
+ " </tbody>\n",
940
+ "</table>\n",
941
+ "</div>"
942
+ ],
943
+ "text/plain": [
944
+ " fecha_publicacion \\\n",
945
+ "url \n",
946
+ "https://europa.eu/eures/portal/jv-se/jv-details... 10/10/2025 \n",
947
+ "https://europa.eu/eures/portal/jv-se/jv-details... 10/10/2025 \n",
948
+ "https://europa.eu/eures/portal/jv-se/jv-details... 10/10/2025 \n",
949
+ "https://europa.eu/eures/portal/jv-se/jv-details... 10/10/2025 \n",
950
+ "https://europa.eu/eures/portal/jv-se/jv-details... 10/10/2025 \n",
951
+ "\n",
952
+ " fecha_limite \\\n",
953
+ "url \n",
954
+ "https://europa.eu/eures/portal/jv-se/jv-details... 31/10/2025 \n",
955
+ "https://europa.eu/eures/portal/jv-se/jv-details... 10/10/2025 \n",
956
+ "https://europa.eu/eures/portal/jv-se/jv-details... 24/10/2025 \n",
957
+ "https://europa.eu/eures/portal/jv-se/jv-details... 13/10/2025 \n",
958
+ "https://europa.eu/eures/portal/jv-se/jv-details... 20/10/2025 \n",
959
+ "\n",
960
+ " titulo \\\n",
961
+ "url \n",
962
+ "https://europa.eu/eures/portal/jv-se/jv-details... CONDUCTORES DE CAMIÓN, EN GENERAL \n",
963
+ "https://europa.eu/eures/portal/jv-se/jv-details... WORK/LOCATION \n",
964
+ "https://europa.eu/eures/portal/jv-se/jv-details... WORK/LOCATION \n",
965
+ "https://europa.eu/eures/portal/jv-se/jv-details... WORK/LOCATION \n",
966
+ "https://europa.eu/eures/portal/jv-se/jv-details... WORK/LOCATION \n",
967
+ "\n",
968
+ " empresa \\\n",
969
+ "url \n",
970
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
971
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
972
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
973
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
974
+ "https://europa.eu/eures/portal/jv-se/jv-details... NaN \n",
975
+ "\n",
976
+ " ocupacion \\\n",
977
+ "url \n",
978
+ "https://europa.eu/eures/portal/jv-se/jv-details... Conductor de vehículo de carga/conductora de v... \n",
979
+ "https://europa.eu/eures/portal/jv-se/jv-details... Empleado administrativo de archivos/empleada a... \n",
980
+ "https://europa.eu/eures/portal/jv-se/jv-details... Operario especializado en engranajes de automo... \n",
981
+ "https://europa.eu/eures/portal/jv-se/jv-details... Empleado del hogar/empleada del hogar \n",
982
+ "https://europa.eu/eures/portal/jv-se/jv-details... Conductor de servicios de transporte de enferm... \n",
983
+ "\n",
984
+ " descripcion \\\n",
985
+ "url \n",
986
+ "https://europa.eu/eures/portal/jv-se/jv-details... REQUIERE ESTAR EN POSESIÓN DEL CAP. LA EMPRESA... \n",
987
+ "https://europa.eu/eures/portal/jv-se/jv-details... ES BUSCA UNA PERSONA AMB ESTUDIS I EXPERIèNCIA... \n",
988
+ "https://europa.eu/eures/portal/jv-se/jv-details... CERQUEM PROFESSIONALS AMB EXPERIèNCIA EN MUNTA... \n",
989
+ "https://europa.eu/eures/portal/jv-se/jv-details... IMPORTANTE EMPRESA UBICADA EN MERCABARNA PRECI... \n",
990
+ "https://europa.eu/eures/portal/jv-se/jv-details... REQUISITS: ? TITULACIÓ D? ESPECIALISTA EN FARM... \n",
991
+ "\n",
992
+ " pais region \\\n",
993
+ "url \n",
994
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Palencia \n",
995
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Tarragona \n",
996
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Girona \n",
997
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Barcelona \n",
998
+ "https://europa.eu/eures/portal/jv-se/jv-details... España Barcelona \n",
999
+ "\n",
1000
+ " tipo_contrato \n",
1001
+ "url \n",
1002
+ "https://europa.eu/eures/portal/jv-se/jv-details... Contrato \n",
1003
+ "https://europa.eu/eures/portal/jv-se/jv-details... Contrato \n",
1004
+ "https://europa.eu/eures/portal/jv-se/jv-details... Contrato \n",
1005
+ "https://europa.eu/eures/portal/jv-se/jv-details... Contrato \n",
1006
+ "https://europa.eu/eures/portal/jv-se/jv-details... Determinado "
1007
+ ]
1008
+ },
1009
+ "execution_count": 24,
1010
+ "metadata": {},
1011
+ "output_type": "execute_result"
1012
+ }
1013
+ ],
1014
+ "source": [
1015
+ "clean.head()"
1016
+ ]
1017
+ },
1018
+ {
1019
+ "cell_type": "code",
1020
+ "execution_count": 51,
1021
+ "id": "5179ecef",
1022
+ "metadata": {},
1023
+ "outputs": [],
1024
+ "source": [
1025
+ "clean.to_csv(\"ofertas.csv\")"
1026
+ ]
1027
+ },
1028
+ {
1029
+ "cell_type": "markdown",
1030
+ "id": "1409da27",
1031
+ "metadata": {},
1032
+ "source": [
1033
+ "## Análisis títulos repetidos"
1034
+ ]
1035
+ },
1036
+ {
1037
+ "cell_type": "code",
1038
+ "execution_count": 30,
1039
+ "id": "266d5584",
1040
+ "metadata": {},
1041
+ "outputs": [
1042
+ {
1043
+ "data": {
1044
+ "text/plain": [
1045
+ "titulo\n",
1046
+ "WORK/LOCATION 3562\n",
1047
+ "PERSONAL DE LIMPIEZA O LIMPIADORES EN GENERAL 110\n",
1048
+ "CONDUCTORES DE CAMIÓN, EN GENERAL 82\n",
1049
+ "COCINEROS, EN GENERAL 68\n",
1050
+ "ENFERMEROS DE CUIDADOS GENERALES 62\n",
1051
+ " ... \n",
1052
+ "CAMARERO/A (REF.5904) 1\n",
1053
+ "MOZO ALMACEN//REPARTIDOR 1\n",
1054
+ "MONTADORES DE GRANDES ESTRUCTURAS METÁLICAS, EN GENERAL 1\n",
1055
+ "AUXILIARES DE ENFERMERIA/GERIATRIA 1\n",
1056
+ "AUXILIAR DE AYUDA A DOMICILIO - PILOÑA 1\n",
1057
+ "Name: count, Length: 1923, dtype: int64"
1058
+ ]
1059
+ },
1060
+ "execution_count": 30,
1061
+ "metadata": {},
1062
+ "output_type": "execute_result"
1063
+ }
1064
+ ],
1065
+ "source": [
1066
+ "clean = pd.read_csv(\"ofertas.csv\")\n",
1067
+ "clean[\"titulo\"].value_counts()"
1068
+ ]
1069
+ },
1070
+ {
1071
+ "cell_type": "code",
1072
+ "execution_count": 31,
1073
+ "id": "97db7e62",
1074
+ "metadata": {},
1075
+ "outputs": [
1076
+ {
1077
+ "data": {
1078
+ "text/plain": [
1079
+ "(3737, 10)"
1080
+ ]
1081
+ },
1082
+ "execution_count": 31,
1083
+ "metadata": {},
1084
+ "output_type": "execute_result"
1085
+ }
1086
+ ],
1087
+ "source": [
1088
+ "descriptiveName = clean[clean[\"titulo\"] != \"WORK/LOCATION\"]\n",
1089
+ "descriptiveName.shape"
1090
+ ]
1091
+ },
1092
+ {
1093
+ "cell_type": "code",
1094
+ "execution_count": 32,
1095
+ "id": "aa59c34d",
1096
+ "metadata": {},
1097
+ "outputs": [],
1098
+ "source": [
1099
+ "fechas = pd.to_datetime(descriptiveName.fecha_limite.unique(), dayfirst=True)"
1100
+ ]
1101
+ },
1102
+ {
1103
+ "cell_type": "code",
1104
+ "execution_count": 33,
1105
+ "id": "05120e89",
1106
+ "metadata": {},
1107
+ "outputs": [
1108
+ {
1109
+ "data": {
1110
+ "text/plain": [
1111
+ "[Timestamp('2025-10-10 00:00:00'),\n",
1112
+ " Timestamp('2025-10-11 00:00:00'),\n",
1113
+ " Timestamp('2025-10-12 00:00:00'),\n",
1114
+ " Timestamp('2025-10-13 00:00:00'),\n",
1115
+ " Timestamp('2025-10-14 00:00:00'),\n",
1116
+ " Timestamp('2025-10-15 00:00:00'),\n",
1117
+ " Timestamp('2025-10-16 00:00:00'),\n",
1118
+ " Timestamp('2025-10-17 00:00:00'),\n",
1119
+ " Timestamp('2025-10-18 00:00:00'),\n",
1120
+ " Timestamp('2025-10-19 00:00:00'),\n",
1121
+ " Timestamp('2025-10-20 00:00:00'),\n",
1122
+ " Timestamp('2025-10-21 00:00:00'),\n",
1123
+ " Timestamp('2025-10-22 00:00:00'),\n",
1124
+ " Timestamp('2025-10-23 00:00:00'),\n",
1125
+ " Timestamp('2025-10-24 00:00:00'),\n",
1126
+ " Timestamp('2025-10-25 00:00:00'),\n",
1127
+ " Timestamp('2025-10-26 00:00:00'),\n",
1128
+ " Timestamp('2025-10-27 00:00:00'),\n",
1129
+ " Timestamp('2025-10-28 00:00:00'),\n",
1130
+ " Timestamp('2025-10-29 00:00:00'),\n",
1131
+ " Timestamp('2025-10-30 00:00:00'),\n",
1132
+ " Timestamp('2025-10-31 00:00:00'),\n",
1133
+ " Timestamp('2025-11-01 00:00:00'),\n",
1134
+ " Timestamp('2025-11-02 00:00:00'),\n",
1135
+ " Timestamp('2025-11-03 00:00:00'),\n",
1136
+ " Timestamp('2025-11-04 00:00:00'),\n",
1137
+ " Timestamp('2025-11-05 00:00:00'),\n",
1138
+ " Timestamp('2025-11-06 00:00:00'),\n",
1139
+ " Timestamp('2025-11-07 00:00:00'),\n",
1140
+ " Timestamp('2025-11-08 00:00:00'),\n",
1141
+ " Timestamp('2025-11-09 00:00:00'),\n",
1142
+ " Timestamp('2025-11-10 00:00:00'),\n",
1143
+ " Timestamp('2025-11-11 00:00:00'),\n",
1144
+ " Timestamp('2025-11-12 00:00:00'),\n",
1145
+ " Timestamp('2025-11-13 00:00:00'),\n",
1146
+ " Timestamp('2025-11-14 00:00:00'),\n",
1147
+ " Timestamp('2025-11-15 00:00:00'),\n",
1148
+ " Timestamp('2025-11-16 00:00:00'),\n",
1149
+ " Timestamp('2025-11-17 00:00:00'),\n",
1150
+ " Timestamp('2025-11-18 00:00:00'),\n",
1151
+ " Timestamp('2025-11-19 00:00:00'),\n",
1152
+ " Timestamp('2025-11-20 00:00:00'),\n",
1153
+ " Timestamp('2025-11-21 00:00:00'),\n",
1154
+ " Timestamp('2025-11-22 00:00:00'),\n",
1155
+ " Timestamp('2025-11-23 00:00:00'),\n",
1156
+ " Timestamp('2025-11-24 00:00:00'),\n",
1157
+ " Timestamp('2025-11-25 00:00:00'),\n",
1158
+ " Timestamp('2025-11-26 00:00:00'),\n",
1159
+ " Timestamp('2025-11-27 00:00:00'),\n",
1160
+ " Timestamp('2025-11-28 00:00:00'),\n",
1161
+ " Timestamp('2025-11-29 00:00:00'),\n",
1162
+ " Timestamp('2025-11-30 00:00:00'),\n",
1163
+ " Timestamp('2025-12-01 00:00:00'),\n",
1164
+ " Timestamp('2025-12-02 00:00:00'),\n",
1165
+ " Timestamp('2025-12-03 00:00:00'),\n",
1166
+ " Timestamp('2025-12-04 00:00:00'),\n",
1167
+ " Timestamp('2025-12-05 00:00:00'),\n",
1168
+ " Timestamp('2025-12-06 00:00:00'),\n",
1169
+ " Timestamp('2025-12-07 00:00:00'),\n",
1170
+ " Timestamp('2025-12-08 00:00:00'),\n",
1171
+ " Timestamp('2025-12-09 00:00:00'),\n",
1172
+ " Timestamp('2025-12-10 00:00:00'),\n",
1173
+ " Timestamp('2025-12-11 00:00:00'),\n",
1174
+ " Timestamp('2025-12-12 00:00:00'),\n",
1175
+ " Timestamp('2025-12-13 00:00:00'),\n",
1176
+ " Timestamp('2025-12-14 00:00:00'),\n",
1177
+ " Timestamp('2025-12-15 00:00:00'),\n",
1178
+ " Timestamp('2025-12-16 00:00:00'),\n",
1179
+ " Timestamp('2025-12-17 00:00:00'),\n",
1180
+ " Timestamp('2025-12-18 00:00:00'),\n",
1181
+ " Timestamp('2025-12-19 00:00:00'),\n",
1182
+ " Timestamp('2025-12-20 00:00:00'),\n",
1183
+ " Timestamp('2025-12-21 00:00:00'),\n",
1184
+ " Timestamp('2025-12-22 00:00:00'),\n",
1185
+ " Timestamp('2025-12-23 00:00:00'),\n",
1186
+ " Timestamp('2025-12-24 00:00:00'),\n",
1187
+ " Timestamp('2025-12-25 00:00:00'),\n",
1188
+ " Timestamp('2025-12-26 00:00:00'),\n",
1189
+ " Timestamp('2025-12-28 00:00:00'),\n",
1190
+ " Timestamp('2025-12-29 00:00:00'),\n",
1191
+ " Timestamp('2025-12-30 00:00:00'),\n",
1192
+ " Timestamp('2025-12-31 00:00:00'),\n",
1193
+ " Timestamp('2026-01-01 00:00:00'),\n",
1194
+ " Timestamp('2026-01-03 00:00:00'),\n",
1195
+ " Timestamp('2026-01-04 00:00:00'),\n",
1196
+ " Timestamp('2026-01-05 00:00:00'),\n",
1197
+ " Timestamp('2026-01-06 00:00:00'),\n",
1198
+ " Timestamp('2026-01-07 00:00:00'),\n",
1199
+ " Timestamp('2026-01-15 00:00:00'),\n",
1200
+ " Timestamp('2026-01-23 00:00:00'),\n",
1201
+ " Timestamp('2026-02-05 00:00:00'),\n",
1202
+ " Timestamp('2026-02-15 00:00:00'),\n",
1203
+ " Timestamp('2026-02-25 00:00:00'),\n",
1204
+ " Timestamp('2026-03-02 00:00:00'),\n",
1205
+ " Timestamp('2026-03-04 00:00:00'),\n",
1206
+ " Timestamp('2026-03-21 00:00:00'),\n",
1207
+ " Timestamp('2026-10-26 00:00:00')]"
1208
+ ]
1209
+ },
1210
+ "execution_count": 33,
1211
+ "metadata": {},
1212
+ "output_type": "execute_result"
1213
+ }
1214
+ ],
1215
+ "source": [
1216
+ "sorted(fechas)"
1217
+ ]
1218
+ },
1219
+ {
1220
+ "cell_type": "code",
1221
+ "execution_count": 34,
1222
+ "id": "e1729010",
1223
+ "metadata": {},
1224
+ "outputs": [
1225
+ {
1226
+ "data": {
1227
+ "text/plain": [
1228
+ "(3737, 9)"
1229
+ ]
1230
+ },
1231
+ "execution_count": 34,
1232
+ "metadata": {},
1233
+ "output_type": "execute_result"
1234
+ }
1235
+ ],
1236
+ "source": [
1237
+ "descriptiveName.set_index(\"url\", inplace= True)\n",
1238
+ "descriptiveName.shape"
1239
+ ]
1240
+ },
1241
+ {
1242
+ "cell_type": "code",
1243
+ "execution_count": 35,
1244
+ "id": "46b1bf2e",
1245
+ "metadata": {},
1246
+ "outputs": [],
1247
+ "source": [
1248
+ "descriptiveName.to_csv(\"ofertasDescriptive.csv\")"
1249
+ ]
1250
+ },
1251
+ {
1252
+ "cell_type": "code",
1253
+ "execution_count": 36,
1254
+ "id": "1b7891ae",
1255
+ "metadata": {},
1256
+ "outputs": [
1257
+ {
1258
+ "data": {
1259
+ "text/plain": [
1260
+ "{Timestamp('2026-01-02 00:00:00')}"
1261
+ ]
1262
+ },
1263
+ "execution_count": 36,
1264
+ "metadata": {},
1265
+ "output_type": "execute_result"
1266
+ }
1267
+ ],
1268
+ "source": [
1269
+ "set(pd.to_datetime(clean.fecha_limite.unique(), dayfirst=True)) - set(pd.to_datetime(descriptiveName.fecha_limite.unique(), dayfirst=True))"
1270
+ ]
1271
+ },
1272
+ {
1273
+ "cell_type": "code",
1274
+ "execution_count": 37,
1275
+ "id": "a4e92d76",
1276
+ "metadata": {},
1277
+ "outputs": [
1278
+ {
1279
+ "data": {
1280
+ "text/html": [
1281
+ "<div>\n",
1282
+ "<style scoped>\n",
1283
+ " .dataframe tbody tr th:only-of-type {\n",
1284
+ " vertical-align: middle;\n",
1285
+ " }\n",
1286
+ "\n",
1287
+ " .dataframe tbody tr th {\n",
1288
+ " vertical-align: top;\n",
1289
+ " }\n",
1290
+ "\n",
1291
+ " .dataframe thead th {\n",
1292
+ " text-align: right;\n",
1293
+ " }\n",
1294
+ "</style>\n",
1295
+ "<table border=\"1\" class=\"dataframe\">\n",
1296
+ " <thead>\n",
1297
+ " <tr style=\"text-align: right;\">\n",
1298
+ " <th></th>\n",
1299
+ " <th>url</th>\n",
1300
+ " <th>fecha_publicacion</th>\n",
1301
+ " <th>fecha_limite</th>\n",
1302
+ " <th>titulo</th>\n",
1303
+ " <th>empresa</th>\n",
1304
+ " <th>ocupacion</th>\n",
1305
+ " <th>descripcion</th>\n",
1306
+ " <th>pais</th>\n",
1307
+ " <th>region</th>\n",
1308
+ " <th>tipo_contrato</th>\n",
1309
+ " </tr>\n",
1310
+ " </thead>\n",
1311
+ " <tbody>\n",
1312
+ " <tr>\n",
1313
+ " <th>1</th>\n",
1314
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
1315
+ " <td>10/10/2025</td>\n",
1316
+ " <td>10/10/2025</td>\n",
1317
+ " <td>WORK/LOCATION</td>\n",
1318
+ " <td>NaN</td>\n",
1319
+ " <td>Empleado administrativo de archivos/empleada a...</td>\n",
1320
+ " <td>ES BUSCA UNA PERSONA AMB ESTUDIS I EXPERIèNCIA...</td>\n",
1321
+ " <td>España</td>\n",
1322
+ " <td>Tarragona</td>\n",
1323
+ " <td>Contrato</td>\n",
1324
+ " </tr>\n",
1325
+ " <tr>\n",
1326
+ " <th>2</th>\n",
1327
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
1328
+ " <td>10/10/2025</td>\n",
1329
+ " <td>24/10/2025</td>\n",
1330
+ " <td>WORK/LOCATION</td>\n",
1331
+ " <td>NaN</td>\n",
1332
+ " <td>Operario especializado en engranajes de automo...</td>\n",
1333
+ " <td>CERQUEM PROFESSIONALS AMB EXPERIèNCIA EN MUNTA...</td>\n",
1334
+ " <td>España</td>\n",
1335
+ " <td>Girona</td>\n",
1336
+ " <td>Contrato</td>\n",
1337
+ " </tr>\n",
1338
+ " <tr>\n",
1339
+ " <th>3</th>\n",
1340
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
1341
+ " <td>10/10/2025</td>\n",
1342
+ " <td>13/10/2025</td>\n",
1343
+ " <td>WORK/LOCATION</td>\n",
1344
+ " <td>NaN</td>\n",
1345
+ " <td>Empleado del hogar/empleada del hogar</td>\n",
1346
+ " <td>IMPORTANTE EMPRESA UBICADA EN MERCABARNA PRECI...</td>\n",
1347
+ " <td>España</td>\n",
1348
+ " <td>Barcelona</td>\n",
1349
+ " <td>Contrato</td>\n",
1350
+ " </tr>\n",
1351
+ " <tr>\n",
1352
+ " <th>4</th>\n",
1353
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
1354
+ " <td>10/10/2025</td>\n",
1355
+ " <td>20/10/2025</td>\n",
1356
+ " <td>WORK/LOCATION</td>\n",
1357
+ " <td>NaN</td>\n",
1358
+ " <td>Conductor de servicios de transporte de enferm...</td>\n",
1359
+ " <td>REQUISITS: ? TITULACIÓ D? ESPECIALISTA EN FARM...</td>\n",
1360
+ " <td>España</td>\n",
1361
+ " <td>Barcelona</td>\n",
1362
+ " <td>Determinado</td>\n",
1363
+ " </tr>\n",
1364
+ " <tr>\n",
1365
+ " <th>6</th>\n",
1366
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
1367
+ " <td>10/10/2025</td>\n",
1368
+ " <td>20/10/2025</td>\n",
1369
+ " <td>WORK/LOCATION</td>\n",
1370
+ " <td>NaN</td>\n",
1371
+ " <td>Conductor de servicios de transporte de enferm...</td>\n",
1372
+ " <td>T?AGRADARIA TREBALLAR A LA FUNDACIÓ LAFACT ?LA...</td>\n",
1373
+ " <td>España</td>\n",
1374
+ " <td>Barcelona</td>\n",
1375
+ " <td>Contrato</td>\n",
1376
+ " </tr>\n",
1377
+ " <tr>\n",
1378
+ " <th>...</th>\n",
1379
+ " <td>...</td>\n",
1380
+ " <td>...</td>\n",
1381
+ " <td>...</td>\n",
1382
+ " <td>...</td>\n",
1383
+ " <td>...</td>\n",
1384
+ " <td>...</td>\n",
1385
+ " <td>...</td>\n",
1386
+ " <td>...</td>\n",
1387
+ " <td>...</td>\n",
1388
+ " <td>...</td>\n",
1389
+ " </tr>\n",
1390
+ " <tr>\n",
1391
+ " <th>7292</th>\n",
1392
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
1393
+ " <td>11/10/2025</td>\n",
1394
+ " <td>20/11/2025</td>\n",
1395
+ " <td>WORK/LOCATION</td>\n",
1396
+ " <td>NaN</td>\n",
1397
+ " <td>Empleado del hogar/empleada del hogar</td>\n",
1398
+ " <td>CONTRACTE DE SUBSTITUCIÓ PER MATERNITAT PER UN...</td>\n",
1399
+ " <td>España</td>\n",
1400
+ " <td>Tarragona</td>\n",
1401
+ " <td>Determinado</td>\n",
1402
+ " </tr>\n",
1403
+ " <tr>\n",
1404
+ " <th>7293</th>\n",
1405
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
1406
+ " <td>11/10/2025</td>\n",
1407
+ " <td>20/11/2025</td>\n",
1408
+ " <td>WORK/LOCATION</td>\n",
1409
+ " <td>NaN</td>\n",
1410
+ " <td>Mozo de almacén/moza de almacén</td>\n",
1411
+ " <td>EMPRESA DE SERVICIOS AUXILIARES NECESITA PERSO...</td>\n",
1412
+ " <td>España</td>\n",
1413
+ " <td>Barcelona</td>\n",
1414
+ " <td>Contrato</td>\n",
1415
+ " </tr>\n",
1416
+ " <tr>\n",
1417
+ " <th>7294</th>\n",
1418
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
1419
+ " <td>11/10/2025</td>\n",
1420
+ " <td>20/11/2025</td>\n",
1421
+ " <td>WORK/LOCATION</td>\n",
1422
+ " <td>NaN</td>\n",
1423
+ " <td>Inspector de carga y flete/inspectora de carga...</td>\n",
1424
+ " <td>ACTUALMENTE, DESDE LA DELEGACIÓN DE TARRAGONA ...</td>\n",
1425
+ " <td>España</td>\n",
1426
+ " <td>Barcelona</td>\n",
1427
+ " <td>Determinado</td>\n",
1428
+ " </tr>\n",
1429
+ " <tr>\n",
1430
+ " <th>7295</th>\n",
1431
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
1432
+ " <td>11/10/2025</td>\n",
1433
+ " <td>20/11/2025</td>\n",
1434
+ " <td>WORK/LOCATION</td>\n",
1435
+ " <td>NaN</td>\n",
1436
+ " <td>Profesor de autoescuela/profesora de autoescuela</td>\n",
1437
+ " <td>NDICE CONSULTORÍA Y FORMACIÓN, SOMOS UNA CONSU...</td>\n",
1438
+ " <td>España</td>\n",
1439
+ " <td>Barcelona</td>\n",
1440
+ " <td>Autónomo</td>\n",
1441
+ " </tr>\n",
1442
+ " <tr>\n",
1443
+ " <th>7296</th>\n",
1444
+ " <td>https://europa.eu/eures/portal/jv-se/jv-detail...</td>\n",
1445
+ " <td>11/10/2025</td>\n",
1446
+ " <td>20/11/2025</td>\n",
1447
+ " <td>WORK/LOCATION</td>\n",
1448
+ " <td>NaN</td>\n",
1449
+ " <td>Mayordomo del servicio doméstico</td>\n",
1450
+ " <td>HELPOINT -ÉS UNA CONSULTORIA ÚNICA ESPECIALITZ...</td>\n",
1451
+ " <td>España</td>\n",
1452
+ " <td>Barcelona</td>\n",
1453
+ " <td>Contrato</td>\n",
1454
+ " </tr>\n",
1455
+ " </tbody>\n",
1456
+ "</table>\n",
1457
+ "<p>3562 rows × 10 columns</p>\n",
1458
+ "</div>"
1459
+ ],
1460
+ "text/plain": [
1461
+ " url fecha_publicacion \\\n",
1462
+ "1 https://europa.eu/eures/portal/jv-se/jv-detail... 10/10/2025 \n",
1463
+ "2 https://europa.eu/eures/portal/jv-se/jv-detail... 10/10/2025 \n",
1464
+ "3 https://europa.eu/eures/portal/jv-se/jv-detail... 10/10/2025 \n",
1465
+ "4 https://europa.eu/eures/portal/jv-se/jv-detail... 10/10/2025 \n",
1466
+ "6 https://europa.eu/eures/portal/jv-se/jv-detail... 10/10/2025 \n",
1467
+ "... ... ... \n",
1468
+ "7292 https://europa.eu/eures/portal/jv-se/jv-detail... 11/10/2025 \n",
1469
+ "7293 https://europa.eu/eures/portal/jv-se/jv-detail... 11/10/2025 \n",
1470
+ "7294 https://europa.eu/eures/portal/jv-se/jv-detail... 11/10/2025 \n",
1471
+ "7295 https://europa.eu/eures/portal/jv-se/jv-detail... 11/10/2025 \n",
1472
+ "7296 https://europa.eu/eures/portal/jv-se/jv-detail... 11/10/2025 \n",
1473
+ "\n",
1474
+ " fecha_limite titulo empresa \\\n",
1475
+ "1 10/10/2025 WORK/LOCATION NaN \n",
1476
+ "2 24/10/2025 WORK/LOCATION NaN \n",
1477
+ "3 13/10/2025 WORK/LOCATION NaN \n",
1478
+ "4 20/10/2025 WORK/LOCATION NaN \n",
1479
+ "6 20/10/2025 WORK/LOCATION NaN \n",
1480
+ "... ... ... ... \n",
1481
+ "7292 20/11/2025 WORK/LOCATION NaN \n",
1482
+ "7293 20/11/2025 WORK/LOCATION NaN \n",
1483
+ "7294 20/11/2025 WORK/LOCATION NaN \n",
1484
+ "7295 20/11/2025 WORK/LOCATION NaN \n",
1485
+ "7296 20/11/2025 WORK/LOCATION NaN \n",
1486
+ "\n",
1487
+ " ocupacion \\\n",
1488
+ "1 Empleado administrativo de archivos/empleada a... \n",
1489
+ "2 Operario especializado en engranajes de automo... \n",
1490
+ "3 Empleado del hogar/empleada del hogar \n",
1491
+ "4 Conductor de servicios de transporte de enferm... \n",
1492
+ "6 Conductor de servicios de transporte de enferm... \n",
1493
+ "... ... \n",
1494
+ "7292 Empleado del hogar/empleada del hogar \n",
1495
+ "7293 Mozo de almacén/moza de almacén \n",
1496
+ "7294 Inspector de carga y flete/inspectora de carga... \n",
1497
+ "7295 Profesor de autoescuela/profesora de autoescuela \n",
1498
+ "7296 Mayordomo del servicio doméstico \n",
1499
+ "\n",
1500
+ " descripcion pais region \\\n",
1501
+ "1 ES BUSCA UNA PERSONA AMB ESTUDIS I EXPERIèNCIA... España Tarragona \n",
1502
+ "2 CERQUEM PROFESSIONALS AMB EXPERIèNCIA EN MUNTA... España Girona \n",
1503
+ "3 IMPORTANTE EMPRESA UBICADA EN MERCABARNA PRECI... España Barcelona \n",
1504
+ "4 REQUISITS: ? TITULACIÓ D? ESPECIALISTA EN FARM... España Barcelona \n",
1505
+ "6 T?AGRADARIA TREBALLAR A LA FUNDACIÓ LAFACT ?LA... España Barcelona \n",
1506
+ "... ... ... ... \n",
1507
+ "7292 CONTRACTE DE SUBSTITUCIÓ PER MATERNITAT PER UN... España Tarragona \n",
1508
+ "7293 EMPRESA DE SERVICIOS AUXILIARES NECESITA PERSO... España Barcelona \n",
1509
+ "7294 ACTUALMENTE, DESDE LA DELEGACIÓN DE TARRAGONA ... España Barcelona \n",
1510
+ "7295 NDICE CONSULTORÍA Y FORMACIÓN, SOMOS UNA CONSU... España Barcelona \n",
1511
+ "7296 HELPOINT -ÉS UNA CONSULTORIA ÚNICA ESPECIALITZ... España Barcelona \n",
1512
+ "\n",
1513
+ " tipo_contrato \n",
1514
+ "1 Contrato \n",
1515
+ "2 Contrato \n",
1516
+ "3 Contrato \n",
1517
+ "4 Determinado \n",
1518
+ "6 Contrato \n",
1519
+ "... ... \n",
1520
+ "7292 Determinado \n",
1521
+ "7293 Contrato \n",
1522
+ "7294 Determinado \n",
1523
+ "7295 Autónomo \n",
1524
+ "7296 Contrato \n",
1525
+ "\n",
1526
+ "[3562 rows x 10 columns]"
1527
+ ]
1528
+ },
1529
+ "execution_count": 37,
1530
+ "metadata": {},
1531
+ "output_type": "execute_result"
1532
+ }
1533
+ ],
1534
+ "source": [
1535
+ "clean[clean[\"titulo\"] == \"WORK/LOCATION\"]"
1536
+ ]
1537
+ },
1538
+ {
1539
+ "cell_type": "code",
1540
+ "execution_count": 38,
1541
+ "id": "edcc514b",
1542
+ "metadata": {},
1543
+ "outputs": [
1544
+ {
1545
+ "data": {
1546
+ "text/plain": [
1547
+ "ocupacion\n",
1548
+ "Empleado del hogar/empleada del hogar 306\n",
1549
+ "Mozo de almacén/moza de almacén 251\n",
1550
+ "Barrendero/barrendera 248\n",
1551
+ "Empleado de oficina/empleada de oficina 214\n",
1552
+ "Auxiliar de enfermería 190\n",
1553
+ " ... \n",
1554
+ "Técnico agrícola/técnica agrícola 1\n",
1555
+ "técnico en geología/técnica en geología 1\n",
1556
+ "Agente de conservación forestal 1\n",
1557
+ "supervisor de destilería/supervisora de destilería 1\n",
1558
+ "ingeniero técnico agrícola/ingeniera técnica agrícola 1\n",
1559
+ "Name: count, Length: 463, dtype: int64"
1560
+ ]
1561
+ },
1562
+ "execution_count": 38,
1563
+ "metadata": {},
1564
+ "output_type": "execute_result"
1565
+ }
1566
+ ],
1567
+ "source": [
1568
+ "clean[\"ocupacion\"].value_counts()"
1569
+ ]
1570
+ },
1571
+ {
1572
+ "cell_type": "markdown",
1573
+ "id": "253da616",
1574
+ "metadata": {},
1575
+ "source": [
1576
+ "Pese a que no todos las ofertas tienen título, si tienen ocupación, por lo que se puede usar para clasificar aparte del título.\n",
1577
+ "\n",
1578
+ "\n",
1579
+ "Aun así, lo guardamos en 2 csv:\n",
1580
+ "- `ofertas.csv`: Todas las 7299 ofertas, 3562 sin título\n",
1581
+ "- `ofertasDescriptive.csv`: Solo las 3737 ofertas con nombre descriptivo"
1582
+ ]
1583
+ },
1584
+ {
1585
+ "cell_type": "code",
1586
+ "execution_count": 39,
1587
+ "id": "c89aca32",
1588
+ "metadata": {},
1589
+ "outputs": [
1590
+ {
1591
+ "data": {
1592
+ "text/plain": [
1593
+ "url 0.000000\n",
1594
+ "fecha_publicacion 0.000000\n",
1595
+ "fecha_limite 0.000000\n",
1596
+ "titulo 0.000000\n",
1597
+ "empresa 99.205371\n",
1598
+ "ocupacion 10.056172\n",
1599
+ "descripcion 0.000000\n",
1600
+ "pais 0.000000\n",
1601
+ "region 1.561858\n",
1602
+ "tipo_contrato 0.027401\n",
1603
+ "dtype: float64"
1604
+ ]
1605
+ },
1606
+ "execution_count": 39,
1607
+ "metadata": {},
1608
+ "output_type": "execute_result"
1609
+ }
1610
+ ],
1611
+ "source": [
1612
+ "clean.isna().sum() / 7299 *100 "
1613
+ ]
1614
+ },
1615
+ {
1616
+ "cell_type": "markdown",
1617
+ "id": "56fbbeb8",
1618
+ "metadata": {},
1619
+ "source": [
1620
+ "## Anonimización de la base de datos"
1621
+ ]
1622
+ },
1623
+ {
1624
+ "cell_type": "markdown",
1625
+ "id": "8d8ba573",
1626
+ "metadata": {},
1627
+ "source": [
1628
+ "Para cumplir con los principios FAIR es necesario anonimizar la base de datos, que en nuestro caso corresponde con eliminar los correos electrónicos y números de teléfono presentes en los datos."
1629
+ ]
1630
+ },
1631
+ {
1632
+ "cell_type": "code",
1633
+ "execution_count": 14,
1634
+ "id": "5d113a02",
1635
+ "metadata": {},
1636
+ "outputs": [
1637
+ {
1638
+ "data": {
1639
+ "text/plain": [
1640
+ "titulo\n",
1641
+ "WORK/LOCATION 3562\n",
1642
+ "PERSONAL DE LIMPIEZA O LIMPIADORES EN GENERAL 110\n",
1643
+ "CONDUCTORES DE CAMIÓN, EN GENERAL 82\n",
1644
+ "COCINEROS, EN GENERAL 68\n",
1645
+ "ENFERMEROS DE CUIDADOS GENERALES 62\n",
1646
+ " ... \n",
1647
+ "CAMARERO/A (REF.5904) 1\n",
1648
+ "MOZO ALMACEN//REPARTIDOR 1\n",
1649
+ "MONTADORES DE GRANDES ESTRUCTURAS METÁLICAS, EN GENERAL 1\n",
1650
+ "AUXILIARES DE ENFERMERIA/GERIATRIA 1\n",
1651
+ "AUXILIAR DE AYUDA A DOMICILIO - PILOÑA 1\n",
1652
+ "Name: count, Length: 1923, dtype: int64"
1653
+ ]
1654
+ },
1655
+ "execution_count": 14,
1656
+ "metadata": {},
1657
+ "output_type": "execute_result"
1658
+ }
1659
+ ],
1660
+ "source": [
1661
+ "clean = pd.read_csv(\"ofertas.csv\")\n",
1662
+ "clean[\"titulo\"].value_counts()"
1663
+ ]
1664
+ },
1665
+ {
1666
+ "cell_type": "code",
1667
+ "execution_count": 17,
1668
+ "id": "4f7a1ed5",
1669
+ "metadata": {},
1670
+ "outputs": [
1671
+ {
1672
+ "data": {
1673
+ "text/html": [
1674
+ "<div>\n",
1675
+ "<style scoped>\n",
1676
+ " .dataframe tbody tr th:only-of-type {\n",
1677
+ " vertical-align: middle;\n",
1678
+ " }\n",
1679
+ "\n",
1680
+ " .dataframe tbody tr th {\n",
1681
+ " vertical-align: top;\n",
1682
+ " }\n",
1683
+ "\n",
1684
+ " .dataframe thead th {\n",
1685
+ " text-align: right;\n",
1686
+ " }\n",
1687
+ "</style>\n",
1688
+ "<table border=\"1\" class=\"dataframe\">\n",
1689
+ " <thead>\n",
1690
+ " <tr style=\"text-align: right;\">\n",
1691
+ " <th></th>\n",
1692
+ " <th>index</th>\n",
1693
+ " <th>column</th>\n",
1694
+ " <th>type</th>\n",
1695
+ " <th>match</th>\n",
1696
+ " </tr>\n",
1697
+ " </thead>\n",
1698
+ " <tbody>\n",
1699
+ " <tr>\n",
1700
+ " <th>0</th>\n",
1701
+ " <td>13</td>\n",
1702
+ " <td>descripcion</td>\n",
1703
+ " <td>email</td>\n",
1704
+ " <td>ECYLDOCTORFLEMING.OFERTAS@JCYL.ES</td>\n",
1705
+ " </tr>\n",
1706
+ " <tr>\n",
1707
+ " <th>1</th>\n",
1708
+ " <td>16</td>\n",
1709
+ " <td>descripcion</td>\n",
1710
+ " <td>email</td>\n",
1711
+ " <td>ECYLDOCTORFLEMING.OFERTAS@JCYL.ES</td>\n",
1712
+ " </tr>\n",
1713
+ " <tr>\n",
1714
+ " <th>2</th>\n",
1715
+ " <td>19</td>\n",
1716
+ " <td>descripcion</td>\n",
1717
+ " <td>email</td>\n",
1718
+ " <td>laboral@grupoperezespinosa.com</td>\n",
1719
+ " </tr>\n",
1720
+ " <tr>\n",
1721
+ " <th>3</th>\n",
1722
+ " <td>20</td>\n",
1723
+ " <td>descripcion</td>\n",
1724
+ " <td>email</td>\n",
1725
+ " <td>inaem.oebinefar@aragon.es</td>\n",
1726
+ " </tr>\n",
1727
+ " <tr>\n",
1728
+ " <th>4</th>\n",
1729
+ " <td>50</td>\n",
1730
+ " <td>descripcion</td>\n",
1731
+ " <td>email</td>\n",
1732
+ " <td>inaem.oebinefar@aragon.es</td>\n",
1733
+ " </tr>\n",
1734
+ " <tr>\n",
1735
+ " <th>...</th>\n",
1736
+ " <td>...</td>\n",
1737
+ " <td>...</td>\n",
1738
+ " <td>...</td>\n",
1739
+ " <td>...</td>\n",
1740
+ " </tr>\n",
1741
+ " <tr>\n",
1742
+ " <th>2989</th>\n",
1743
+ " <td>6845</td>\n",
1744
+ " <td>descripcion</td>\n",
1745
+ " <td>phone_spain</td>\n",
1746
+ " <td>976216157</td>\n",
1747
+ " </tr>\n",
1748
+ " <tr>\n",
1749
+ " <th>2990</th>\n",
1750
+ " <td>6975</td>\n",
1751
+ " <td>descripcion</td>\n",
1752
+ " <td>phone_spain</td>\n",
1753
+ " <td>987249530</td>\n",
1754
+ " </tr>\n",
1755
+ " <tr>\n",
1756
+ " <th>2991</th>\n",
1757
+ " <td>7008</td>\n",
1758
+ " <td>descripcion</td>\n",
1759
+ " <td>phone_spain</td>\n",
1760
+ " <td>987249530</td>\n",
1761
+ " </tr>\n",
1762
+ " <tr>\n",
1763
+ " <th>2992</th>\n",
1764
+ " <td>7116</td>\n",
1765
+ " <td>descripcion</td>\n",
1766
+ " <td>phone_spain</td>\n",
1767
+ " <td>976216157</td>\n",
1768
+ " </tr>\n",
1769
+ " <tr>\n",
1770
+ " <th>2993</th>\n",
1771
+ " <td>7214</td>\n",
1772
+ " <td>descripcion</td>\n",
1773
+ " <td>phone_spain</td>\n",
1774
+ " <td>976216157</td>\n",
1775
+ " </tr>\n",
1776
+ " </tbody>\n",
1777
+ "</table>\n",
1778
+ "<p>2994 rows × 4 columns</p>\n",
1779
+ "</div>"
1780
+ ],
1781
+ "text/plain": [
1782
+ " index column type match\n",
1783
+ "0 13 descripcion email ECYLDOCTORFLEMING.OFERTAS@JCYL.ES\n",
1784
+ "1 16 descripcion email ECYLDOCTORFLEMING.OFERTAS@JCYL.ES\n",
1785
+ "2 19 descripcion email laboral@grupoperezespinosa.com\n",
1786
+ "3 20 descripcion email inaem.oebinefar@aragon.es\n",
1787
+ "4 50 descripcion email inaem.oebinefar@aragon.es\n",
1788
+ "... ... ... ... ...\n",
1789
+ "2989 6845 descripcion phone_spain 976216157\n",
1790
+ "2990 6975 descripcion phone_spain 987249530\n",
1791
+ "2991 7008 descripcion phone_spain 987249530\n",
1792
+ "2992 7116 descripcion phone_spain 976216157\n",
1793
+ "2993 7214 descripcion phone_spain 976216157\n",
1794
+ "\n",
1795
+ "[2994 rows x 4 columns]"
1796
+ ]
1797
+ },
1798
+ "execution_count": 17,
1799
+ "metadata": {},
1800
+ "output_type": "execute_result"
1801
+ }
1802
+ ],
1803
+ "source": [
1804
+ "# expresiones regulares\n",
1805
+ "email_regex = re.compile(\n",
1806
+ " r\"\"\"[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@\n",
1807
+ " [a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)+\"\"\",\n",
1808
+ " flags=re.VERBOSE | re.IGNORECASE\n",
1809
+ ")\n",
1810
+ "\n",
1811
+ "phone_regex_spain = re.compile(\n",
1812
+ " r\"(?:\\+34\\s?)?(?:6|7|8|9)\\d{8}\\b\" \n",
1813
+ ")\n",
1814
+ "\n",
1815
+ "# buscar coincidencias en el DataFrame\n",
1816
+ "def find_pii(df: pd.DataFrame, target_col: str = \"descripcion\"):\n",
1817
+ " \"\"\"\n",
1818
+ " Busca correos y teléfonos del DataFrame.\n",
1819
+ " \"\"\"\n",
1820
+ " hits = []\n",
1821
+ " ser = df[target_col].astype(str).fillna(\"\")\n",
1822
+ "\n",
1823
+ " # emails\n",
1824
+ " mask_email = ser.str.contains(email_regex, regex=True, na=False)\n",
1825
+ " for idx in df.index[mask_email]:\n",
1826
+ " matches = re.findall(email_regex, df.at[idx, target_col])\n",
1827
+ " for match in matches:\n",
1828
+ " hits.append((idx, target_col, \"email\", match))\n",
1829
+ "\n",
1830
+ " # teléfonos\n",
1831
+ " mask_phone_spain = ser.str.contains(phone_regex_spain, regex=True, na=False)\n",
1832
+ " for idx in df.index[mask_phone_spain]:\n",
1833
+ " matches = re.findall(phone_regex_spain, df.at[idx, target_col])\n",
1834
+ " for match in matches:\n",
1835
+ " hits.append((idx, target_col, \"phone_spain\", match))\n",
1836
+ "\n",
1837
+ " # devolver resultados como DataFrame\n",
1838
+ " result = pd.DataFrame(hits, columns=[\"index\", \"column\", \"type\", \"match\"])\n",
1839
+ " return result\n",
1840
+ "\n",
1841
+ "find_pii(clean)"
1842
+ ]
1843
+ },
1844
+ {
1845
+ "cell_type": "code",
1846
+ "execution_count": 18,
1847
+ "id": "89fc7b6e",
1848
+ "metadata": {},
1849
+ "outputs": [],
1850
+ "source": [
1851
+ "# función para anonimizar el DataFrame\n",
1852
+ "def anonymize_df(df: pd.DataFrame, target_col: str = \"descripcion\", replace_email: str = \"[EMAIL]\", replace_phone: str = \"[PHONE]\"):\n",
1853
+ " \"\"\"\n",
1854
+ " Anonimiza la columna indicada reemplazando correos y teléfonos por etiquetas.\n",
1855
+ " \"\"\"\n",
1856
+ " df2 = df.copy()\n",
1857
+ "\n",
1858
+ " if pd.api.types.is_string_dtype(df2[target_col]) or pd.api.types.is_object_dtype(df2[target_col]):\n",
1859
+ " df2[target_col] = df2[target_col].astype(str)\n",
1860
+ " # correos\n",
1861
+ " df2[target_col] = df2[target_col].str.replace(email_regex, replace_email, regex=True)\n",
1862
+ " # teléfonos\n",
1863
+ " df2[target_col] = df2[target_col].str.replace(phone_regex_spain, replace_phone, regex=True)\n",
1864
+ " return df2\n",
1865
+ "\n",
1866
+ "\n",
1867
+ "anonim=anonymize_df(clean)"
1868
+ ]
1869
+ },
1870
+ {
1871
+ "cell_type": "code",
1872
+ "execution_count": 20,
1873
+ "id": "2df15258",
1874
+ "metadata": {},
1875
+ "outputs": [],
1876
+ "source": [
1877
+ "anonim.to_csv(\"ofertasAnonimizado.csv\",index=False)"
1878
+ ]
1879
+ }
1880
+ ],
1881
+ "metadata": {
1882
+ "kernelspec": {
1883
+ "display_name": "Python 3",
1884
+ "language": "python",
1885
+ "name": "python3"
1886
+ },
1887
+ "language_info": {
1888
+ "codemirror_mode": {
1889
+ "name": "ipython",
1890
+ "version": 3
1891
+ },
1892
+ "file_extension": ".py",
1893
+ "mimetype": "text/x-python",
1894
+ "name": "python",
1895
+ "nbconvert_exporter": "python",
1896
+ "pygments_lexer": "ipython3",
1897
+ "version": "3.13.2"
1898
+ }
1899
+ },
1900
+ "nbformat": 4,
1901
+ "nbformat_minor": 5
1902
+ }
README.md CHANGED
@@ -1,3 +1,158 @@
1
- ---
2
- license: cc-by-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ofertas de Empleo Públicas en España (EURES, 2025)
2
+
3
+ ## Dataset Summary
4
+
5
+ Este dataset recopila ofertas de empleo publicadas en portales oficiales de empleo europeos y españoles, principalmente a través de la red **EURES (European Employment Services)**.
6
+ Forma parte del proyecto desarrollado para la práctica de la **Universidad Politécnica de Madrid (UPM)** en la asignatura *Descubrimiento del Conocimiento en Datos Complejos*.
7
+
8
+ El dataset tiene como propósito servir como fuente de información para análisis del mercado laboral, extracción de información, y aplicaciones de minería de texto o aprendizaje automático sobre descripciones de empleo públicas.
9
+
10
+ Los datos proceden íntegramente de fuentes **públicas y abiertas** bajo políticas de datos abiertos gubernamentales.
11
+ El **Rango temporal de los datos** abarca desde el 10 de octubre de 2025 hasta el 26 de octubre de 2026.
12
+
13
+ ---
14
+
15
+ ## Changelog
16
+
17
+ **Versión 1.0 – Octubre 2025**
18
+ - Primera versión del dataset.
19
+ - Datos extraídos de portales oficiales mediante scrapers basados en Playwright.
20
+ - Limpieza, normalización y exportación final en formato CSV.
21
+
22
+ ---
23
+
24
+ ## How to use
25
+
26
+ El dataset se encuentra disponible en formato **CSV UTF-8**. Puede cargarse directamente en entornos de análisis de datos.
27
+
28
+ ### Ejemplo en Python
29
+ ```python
30
+ import pandas as pd
31
+
32
+ df = pd.read_csv("empleos_espanoles_eures_2025.csv")
33
+ print(df.head())
34
+ ```
35
+
36
+ ### Ejemplo con Hugging Face Datasets
37
+ ```python
38
+ from datasets import load_dataset
39
+
40
+ ds = load_dataset("MiguelGP-13/empleos-espanoles-eures-2025")
41
+ ```
42
+
43
+ ---
44
+
45
+ ### Data Structure
46
+
47
+ | Campo | Descripción | Tipo |
48
+ |--------|--------------|------|
49
+ | `url` | Enlace a la oferta original en el portal EURES o fuente autonómica oficial | string |
50
+ | `fecha_publicacion` | Fecha de publicación de la oferta (DD/MM/AAAA) | date |
51
+ | `fecha_limite` | Fecha límite para postular | date |
52
+ | `titulo` | Título del puesto ofertado | string |
53
+ | `empresa` | Nombre de la empresa o entidad contratante (si está disponible) | string |
54
+ | `ocupacion` | Ocupación o categoría profesional principal | string |
55
+ | `descripcion` | Descripción textual completa del puesto (sin datos personales) | string |
56
+ | `pais` | País de la oferta | string |
57
+ | `region` | Comunidad autónoma o provincia | string |
58
+ | `tipo_contrato` | Tipo de contrato o modalidad laboral | string |
59
+
60
+ Formato de archivo: `CSV UTF-8`
61
+ Número estimado de registros: variable (según fecha de ejecución del scraper).
62
+ Frecuencia de actualización: única (los scripts permiten obtener datos actualizados en futuras ejecuciones).
63
+
64
+ ---
65
+
66
+ ### Data Collection
67
+
68
+ Los datos fueron recolectados mediante **scripts de scraping** desarrollados en Python utilizando la librería **Playwright**.
69
+ Se accedió de manera automatizada a las ofertas publicadas en el portal **EURES** y, en algunos casos, a portales autonómicos integrados en la red pública de empleo.
70
+
71
+ #### Descripción del proceso de recolección:
72
+ 1. Obtención de listados de URLs de ofertas a partir de buscadores públicos de empleo.
73
+ 2. Acceso controlado a cada página con Playwright, respetando límites de concurrencia y tiempos de espera para evitar sobrecarga.
74
+ 3. Extracción de información mediante selectores identificados (`id` y `class`) en la estructura HTML.
75
+ 4. Registro de cada oferta en formato tabular (`.csv`), garantizando que los campos principales estén completos.
76
+
77
+ Todos los datos proceden de fuentes públicas de libre acceso, sin necesidad de autenticación ni recopilación de información personal.
78
+
79
+ ---
80
+
81
+ ### Data Processing
82
+
83
+ El dataset fue sometido a un proceso de limpieza y estandarización que incluyó:
84
+
85
+ #### Normalización y formato
86
+ - Conversión de fechas al formato `DD/MM/AAAA`
87
+ - Conversión del archivo a codificación UTF-8
88
+ - Limpieza de saltos de línea y espacios redundantes
89
+
90
+ #### Limpieza textual
91
+ - Eliminación de caracteres HTML en las descripciones
92
+ - Traducción de textos en catalán al castellano
93
+ - Anonimización de datos personales (correos electrónicos y teléfonos)
94
+
95
+ #### Filtrado y depuración
96
+ - Eliminación de anuncios que no están en español
97
+ - Eliminación de ofertas sin fecha límite de solicitud
98
+ - Eliminación de columnas con datos mal obtenidos, nulos o poco informativos (`educación`, `empresa`, `fecha_publicacion`, `duración de jornada`)
99
+ - Verificación y eliminación de duplicados mediante la columna `url`
100
+
101
+ #### Enriquecimiento estructural
102
+ - Relleno de provincias vacías a partir del contenido de la descripción
103
+ - Renombrado de la columna `region` a `provincia`
104
+
105
+ #### Exportación final
106
+ - Generación del archivo final en formato CSV UTF-8, listo para su publicación
107
+
108
+ ---
109
+
110
+ ### Data Maintenance
111
+
112
+ Este dataset es una **recopilación única (snapshot)** de ofertas publicadas durante octubre de 2025.
113
+
114
+ Responsables de mantenimiento y contacto:
115
+ - Álvaro Felipe – alvaro.felipe@alumnos.upm.es
116
+ - Miguel Gómez – miguel.gprieto@alumnos.upm.es
117
+ - Alex Pérez �� alex.pcarpente@alumnos.upm.es
118
+
119
+ ---
120
+
121
+ ## License
122
+
123
+ Este dataset deriva de datos abiertos del portal EURES, gestionado por la Comisión Europea y la European Labour Authority (ELA), bajo los términos de la Decision 2011/833/EU on the reuse of Commission documents.
124
+
125
+ El procesamiento, normalización y compilación de esta versión se se distribuye bajo la licencia **Creative Commons Attribution 4.0 International (CC BY 4.0)**.
126
+
127
+ En consecuencia, el uso de los datos originales deberá respetar las condiciones de reutilización de la Comisión Europea.
128
+
129
+ **Atribución requerida:**
130
+ > Álvaro Felipe, Miguel Gómez, Alex Pérez (2025). *Ofertas de Empleo Públicas en España (EURES, 2025)*. Universidad Politécnica de Madrid. Licencia CC BY 4.0.
131
+
132
+ En caso de reutilizar o redistribuir el dataset, por favor menciona la fuente y los autores en la forma indicada en la sección de *Citation*.
133
+
134
+ Los datos originales del portal EURES se encuentran disponibles en https://europa.eu/eures/portal/jv-se/home?lang=es
135
+
136
+ ---
137
+
138
+ ## Citation
139
+
140
+ Si utiliza este dataset en publicaciones académicas o proyectos derivados, se recomienda la siguiente cita:
141
+
142
+ > Álvaro Felipe, Miguel Gómez, Alex Pérez (2025). *Ofertas de Empleo Públicas en España (EURES, 2025)* [Dataset]. Universidad Politécnica de Madrid. Disponible en Hugging Face Datasets. Licencia CC BY 4.0.
143
+
144
+ ---
145
+
146
+ ## Acknowledgements
147
+
148
+ Los datos originales provienen de portales de empleo **oficiales y públicos**, principalmente de la red **EURES** y sus integraciones autonómicas.
149
+ Agradecimientos a las instituciones europeas y españolas que mantienen políticas de datos abiertos, y a la comunidad de código abierto por las herramientas utilizadas, en particular:
150
+
151
+ - [Playwright](https://playwright.dev/) – automatización de navegación web.
152
+ - [Pandas](https://pandas.pydata.org/) – procesamiento y análisis de datos.
153
+ - [Hugging Face Datasets](https://huggingface.co/docs/datasets) – publicación y distribución abierta de datasets.
154
+
155
+ ---
156
+
157
+ *Última actualización: 15 de octubre de 2025*
158
+ *Versión: 1.0*
clean_csv.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+ import csv
3
+
4
+ def clean_csv(input_file, output_file):
5
+ # Lista para almacenar las filas limpias
6
+ clean_rows = []
7
+
8
+ # Leer el archivo original manteniendo las comillas
9
+ with open(input_file, 'r', encoding='utf-8') as file:
10
+ # Usar el csv.reader con un delimitador de punto y coma
11
+ csv_reader = csv.reader(file, delimiter=';', quotechar='"')
12
+ header = next(csv_reader) # Guardar la cabecera
13
+ clean_rows.append(header)
14
+
15
+ for row in csv_reader:
16
+ # Limpiar cada campo de la fila
17
+ cleaned_row = [field.replace('\n', ' ').replace('\r', ' ').strip() for field in row]
18
+ clean_rows.append(cleaned_row)
19
+
20
+ # Escribir el archivo limpio
21
+ with open(output_file, 'w', encoding='utf-8', newline='') as file:
22
+ csv_writer = csv.writer(file, delimiter=';', quotechar='"', quoting=csv.QUOTE_MINIMAL)
23
+ csv_writer.writerows(clean_rows)
24
+
25
+ if __name__ == "__main__":
26
+ clean_csv('eures-utf8.csv', 'eures_clean_new.csv')
empleos-espanoles-eures-2025.csv ADDED
The diff for this file is too large to render. See raw diff
 
metadata.json ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "title": "Ofertas de Empleo Públicas en España (EURES, 2025)",
3
+ "description": "Este dataset recopila ofertas de empleo publicadas en portales oficiales de empleo europeos y españoles, principalmente a través de la red EURES. Fue desarrollado como parte de un proyecto académico en la Universidad Politécnica de Madrid (UPM) y está destinado al análisis del mercado laboral, minería de texto y aprendizaje automático sobre descripciones de empleo públicas.",
4
+ "version": "1.0",
5
+ "last_updated": "2025-10-15",
6
+ "license": "CC BY 4.0",
7
+ "citation": "Álvaro Felipe, Miguel Gómez, Alex Pérez (2025). Ofertas de Empleo Públicas en España (EURES, 2025) [Dataset]. Universidad Politécnica de Madrid. Disponible en Hugging Face Datasets. Licencia CC BY 4.0.",
8
+ "creators": [
9
+ {
10
+ "name": "Álvaro Felipe",
11
+ "email": "alvaro.felipe@alumnos.upm.es"
12
+ },
13
+ {
14
+ "name": "Miguel Gómez",
15
+ "email": "miguel.gprieto@alumnos.upm.es"
16
+ },
17
+ {
18
+ "name": "Alex Pérez",
19
+ "email": "alex.pcarpente@alumnos.upm.es"
20
+ }
21
+ ],
22
+ "language": ["es"],
23
+ "source": "https://europa.eu/eures/portal/jv-se/home?lang=es",
24
+ "data_format": "CSV UTF-8",
25
+ "features": {
26
+ "url": "string",
27
+ "fecha_publicacion": "date",
28
+ "fecha_limite": "date",
29
+ "titulo": "string",
30
+ "empresa": "string",
31
+ "ocupacion": "string",
32
+ "descripcion": "string",
33
+ "pais": "string",
34
+ "region": "string",
35
+ "tipo_contrato": "string"
36
+ },
37
+ "collection_method": {
38
+ "type": "web scraping",
39
+ "tools": ["Playwright", "Python"],
40
+ "notes": "Extracción automatizada desde portales públicos de empleo europeos y autonómicos. Se respetaron límites de concurrencia y tiempos de espera."
41
+ },
42
+ "processing": {
43
+ "steps": [
44
+ "Normalización de fechas al formato DD/MM/AAAA",
45
+ "Eliminación de caracteres HTML, saltos de línea y espacios redundantes en las descripciones",
46
+ "Anonimización de datos personales (correos electrónicos y teléfonos)",
47
+ "Verificación y eliminación de duplicados mediante la columna 'url'",
48
+ "Eliminación de anuncios que no están en español",
49
+ "Eliminación de columnas con datos mal obtenidos, nulos o irrelevantes ('educación', 'empresa', 'fecha_publicacion', 'duración de jornada')",
50
+ "Eliminación de ofertas sin fecha límite de solicitud",
51
+ "Conversión del archivo a codificación UTF-8 y limpieza de saltos de línea",
52
+ "Traducción de textos en catalán al castellano",
53
+ "Relleno de provincias vacías a partir del contenido de la descripción",
54
+ "Renombrado de la columna 'region' a 'provincia'",
55
+ "Exportación final a CSV UTF-8 listo para su publicación"
56
+ ]
57
+ },
58
+ "distribution": {
59
+ "platform": "Hugging Face Datasets",
60
+ "access": "pública",
61
+ "update_frequency": "never"
62
+ },
63
+ "keywords": [
64
+ "empleo",
65
+ "EURES",
66
+ "mercado laboral",
67
+ "España",
68
+ "scraping",
69
+ "minería de texto",
70
+ "aprendizaje automático",
71
+ "datos abiertos"
72
+ ]
73
+ }