Re: [Matplotlib-users] Handling data and creating arrays

2008-06-13 Thread washakie
Okay?? That does seem to work... I guess I'd better go read up on index_tricks.py ? Thanks. Alan G Isaac wrote: > x1,y1,x2,y2 =np.random.random((4,20)) data = dict(var1=(x1,y1), var2=(x2,y2)) a = np.c_[[d for xy in data.values() for d in xy]] a > array([[ 0.66613738, 0.

Re: [Matplotlib-users] Handling data and creating arrays

2008-06-13 Thread Chris.Barker
washakie wrote: > DataDict={var1:(x1,y1),var2:(x2,y2),var3:(x3,y3)} ; where the x and y's are > generally lists. You might be able to use numpy record arrays (recarray). There are lots of good reasons to use numpy arrays other than plotting. -Chris -- Christopher Barker, Ph.D. Oceanographe

Re: [Matplotlib-users] Handling data and creating arrays

2008-06-13 Thread Alan G Isaac
On Fri, 13 Jun 2008, washakie apparently wrote: > DataDict={var1:(x1,y1),var2:(x2,y2),var3:(x3,y3)} ; where > the x and y's are generally lists. > Now that's nice, because I can cycle through the DataDict.keys() to batch > plot, etc. But how can I convert the whole dict into > a single array (

[Matplotlib-users] Handling data and creating arrays

2008-06-13 Thread washakie
Hello, I've started to use the convention of making dictionaries to hold my datasets. But I haven't settled on an approach yet, and would like input from people for how they a) handle their arrays of data, and b) how to create pylab arrays from lists of lists, etc. What I generally have is: Data