Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Floats as keys in dict
- From: brian at rkspeed-rugby.dk (Brian Elmegaard)
- Subject: Floats as keys in dict
- Date: Wed, 01 Aug 2007 08:40:33 -0100
Hi I am making a script to optimiza by dynamic programming. I do not know the vertices and nodes before the calculation, so I have decided to store the nodes I have in play as keys in a dict. However, the dict keys are then floats and I have to round the values of new possible nodes in each step. When profiling I see that the most time consuming part of my script is rounding. Is there a faster way than round() or is there a better way to test than 'in' or should I store the keys in another way than a dict? tia, -- Brian (remove the sport for mail) http://www.et.web.mek.dtu.dk/Staff/be/be.html http://www.rugbyklubben-speed.dk
- Follow-Ups:
- Floats as keys in dict
- From: Alex Martelli
- Floats as keys in dict
- From: greg
- Floats as keys in dict
- Prev by Date: Where do they tech Python officialy ?
- Next by Date: standalone process to interact with the web
- Previous by thread: calling a .net application from Python 2.5
- Next by thread: Floats as keys in dict
- Index(es):