@@ -230,12 +230,14 @@ def ICA(filepath):
230
230
results .core_file_location ,
231
231
usecols = taxonomic_columns + geographic_columns + temporal_columns ,
232
232
low_memory = False ,
233
+ keep_default_na = False
233
234
)
234
235
except Exception as e :
235
236
logger .debug (f"ERROR - { e } " )
236
237
df = results .pd_read (
237
238
results .core_file_location ,
238
239
low_memory = False ,
240
+ keep_default_na = False
239
241
)
240
242
missing_columns = [
241
243
col
@@ -568,7 +570,7 @@ def safe_date(date):
568
570
569
571
# Porcentaje de años validos
570
572
try :
571
- dates ["year" ] = dates . date . str [: 4 ]. astype ( "Int64" )
573
+ dates ["year" ] = df [ df . year . notnull ()]. copy ( )
572
574
percentaje_years = (
573
575
sum ((dates .year >= 0 ) & (dates .year <= datetime .date .today ().year ))
574
576
/ total_data
@@ -580,7 +582,7 @@ def safe_date(date):
580
582
581
583
# Porcentaje de meses validos
582
584
try :
583
- dates ["month" ] = dates . date . str [ 5 : 7 ]. astype ( "Int64" )
585
+ dates ["month" ] = df [ df . month . notnull ()]. copy ( )
584
586
percentaje_months = (
585
587
sum ((dates .month >= 1 ) & (dates .month <= 12 )) / total_data * 100
586
588
)
@@ -590,7 +592,7 @@ def safe_date(date):
590
592
591
593
# Porcentaje de días validos
592
594
try :
593
- dates ["day" ] = dates . date . str [ 8 : 10 ]. astype ( "Int64" )
595
+ dates ["day" ] = df [ df . day . notnull ()]. copy ( )
594
596
percentaje_days = sum ((dates .day >= 1 ) & (dates .day <= 31 )) / total_data * 100
595
597
except Exception as e :
596
598
logger .debug (f"ERROR day - { e } " )
0 commit comments