Say I have a Named Tuple like
a = (switch = dataframe1, swatch = dataframe2)
and I have some structs
struct switch
df::DataFrame
...more fields
end
struct swatch
df::DataFrame
...more fields
end
I want to iterate over the Named Tuples and create the corresponding structs.
What would be the best way to pick the right constructor for the struct corresponding to the key in the Named Tuple (I actually want to create one switch/swatch from each row in the dateframes in the Named Tuple, and in the actual problem there are also swutch
, swytch
and many more. )