Hi!
I aplied a transform script to a table to subsitute header values for others with special uTF-8 characters,
def transform(self, value, quality, timestamp):
new_headers = [
"Equipos de PCI",
"Instalacion electrica",
"Señalización PCI",
"Iluminación emergencia",
"Salidas y vías evac.",
"Señalización evacuación y",
"Señalización riesgo elect.",
"Caída de personas mismo nivel",
"Escalas fijas",
"Escaleras portátiles de mano",
"Iluminación PVD",
"Iluminación resto (no emerg.)",
"Climatiz. (Temp.)",
"Climatiz. (Hr)",
"Climatiz. (CO2)",
"Caída de objetos desprendidos",
"Atropellos",
"Tránsito por cubierta",
"Otros riesgos detallar)"
]
def transform_dataset(dataset):
py_data = system.dataset.toPyDataSet(dataset)
new_data = []
for row in py_data:
new_row = list(row)
new_data.append(new_row)
original_headers = list(py_data.getColumnNames())
modified_headers = original_headers[:2] + new_headers[:len(original_headers)-2]
return system.dataset.toDataSet(modified_headers, new_data)
transformed_data = transform_dataset(value)
return transformed_data
But the special characters as "ñ" are not showing well. Just happens with scripts because with labels wouldn´t happen.
Wonder if there is a solution.