I everyone,
I struggle to convert an array of array like this :
[
["foo","bar","foo","bar","foo"],
["foo","bar","foo","bar","foo"],
["foo","bar","foo","bar","foo"],
["foo","bar","foo","bar","foo"]
]
to an array of tuples (array
, str
) like this:
[
(["foo","bar","foo","bar","foo"], "type1"),
(["foo","bar","foo","bar","foo"], "type1"),
(["foo","bar","foo","bar","foo"], "type1"),
(["foo","bar","foo","bar","foo"], "type1")
]
I did find a way to append the type to the array but it's not exactly what I want:
[
["foo","bar","foo","bar","foo", "type1"],
["foo","bar","foo","bar","foo", "type1"],
["foo","bar","foo","bar","foo", "type1"],
["foo","bar","foo","bar","foo", "type1"]
]
Do you have something better ?
Thanks :)
question from:
https://stackoverflow.com/questions/65952341/how-to-convert-a-array-of-array-to-array-of-tuples