I have the following setup: a function returns a dictionary with N timelines of equal size (100k points). The dictionary returns looks like:
timelines = dict()
timelines["Name1"] = dict()
timelines["Name1"]["Name2"] = dict()
timelines["Name1"]["Name3"] = dict()
timelines["Name1"]["Name2"]["a"] = # List of 100k points
timelines["Name1"]["Name2"]["b"] = # List of 100k points
timelines["Name1"]["Name2"]["c"] = # List of 100k points
timelines["Name1"]["Name3"]["b"] = # List of 100k points
timelines["Name1"]["Name2"]["c"] = # List of 100k points
timelines["Name1"]["a"] = # List of 100k points
timelines["Name1"]["b"] = # List of 100k points
timelines["Name2"] # and so on.
As you might have understood, the timelines (list of points) are not always stored in the same level. Sometimes I can access it with 1 key, sometimes with 2, sometimes with 5. Those keys will give me the labels for the plot and are necessary. My plan was to pass to the plot function a tuple of the keys.
Example:
T = ("Name1", "Name2", "b")
# Will allow me to access the timeline:
timelines["Name1"]["Name2"]["b"]
# by doing:
timelines[T[0]][T[1]][T[2]]
In the example above, I wrote the dictionary path myself ([T[0]][T[1]][T[2]]
), however how can I acess the right timeline with a tuple T of unknown size? How can I unpack the tuple into a dictionary path?
Thanks :)