Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Guardamos las columnas que vamos a combinar
let latitudColumn = frame2021["LATITUD"]
let longitudColumn = frame2021["LONGITUD"]
// Unimos las dos columnas en una nueva
frame2021.combineColumns("LATITUD", "LONGITUD", into: "LOCATION") { (latitud: Double?, longitud: Double?) -> CLLocation? in
guard let latitud = latitud, let longitud = longitud else
{
return nil
}
return CLLocation(latitude: latitud, longitude: longitud)
}
// Volvemos a añadir las columnas que hemos unido
frame2021.append(column: latitudColumn)
frame2021.append(column: longitudColumn)
show(dataframe: frame2021)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment