Double-indexed dictionary

dictionary, python

Solution

You can use any immutable and hashable object as key, including tuples

number_of_read_lengths = {}    
number_of_read_lengths[14,3] = "Your value"

Problem

I want to be able to store and look up values in a dictionary based on two integer values. So when I look up a value I want to use the keys `read_length` and `min_size` to access the element, like so: ``` number_of_read_lengths[read_length][min_size] ``` I know I can create nested dictionaries, but that is a slight hassle. Is there a simple way of doing what I want to do?

Original source