searching a value of a dict (each value is a list)

Seongsu Lee senux at senux.com
Sun Dec 9 12:45:02 EST 2007


On 12월10일, 오전1시53분, Pablo Ziliani <pa... at decode.com.ar> wrote:
> Seongsu Lee escribió:
>
> > Hi,
>
> > I have a dictionary with million keys. Each value in the
> > dictionary has a list with up to thousand integers.
> > (...)
>
> > I want to find out the key value which has a specific
> > integer in the list of its value.
>
> Sorry if this is unhelpful, but have you considered moving your data
> model a proper database?
> I ask because unless someone knows of a specific module, I think we are
> in DB's authentic realm. Is the fastest solution, probably not just for
> this particular operation you are trying to do.
>
> Regards,
> Pablo

Hi Pablo,

Thank you for your posting! I wanted to solve the problem within
a given environment, python, and I think it is solved by
a dictionary with bidirectional key. I have posted it and want to
know if other knows more elegant way to do it.



More information about the Python-list mailing list