On Thu, Mar 5, 2009 at 7:07 PM, psykeedelik <icym...@gmail.com> wrote:
> I usually get properties that I compute, in a dictionary like property > = [key1: val1, key2:val2, ...] and then I usually want to plot them in > pylab, which AFAIK requires x and y as lists for the plot argument. > Then I need to get the lists [key1, key2, ...] and [val1, val2, ...]. > And now I wonder if there a more efficient way doing what I described > above!! ;) If the dict = {key1: val1, key2: val2, ...}, you can do: for key in dict: plot(key,dictionary[key]) -- André Engels, andreeng...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list