Re: Duplicate entries in a matrix

2006-01-19 Thread Robert Kern
Chris Lasher wrote: > Now that's definitely what I'm looking for! Thanks! > > By the way, was this line > > In [5]: C = repeat(B, [1,2,1], axis=-1) > > supposed to have a positive 1 value for axis? It works either way, I > see. Is it like a lookup, where an index of -1 returns the last value? >

Re: Duplicate entries in a matrix

2006-01-19 Thread Chris Lasher
Now that's definitely what I'm looking for! Thanks! By the way, was this line In [5]: C = repeat(B, [1,2,1], axis=-1) supposed to have a positive 1 value for axis? It works either way, I see. Is it like a lookup, where an index of -1 returns the last value? If that were true, I supposed the eval

Re: Duplicate entries in a matrix

2006-01-19 Thread Robert Kern
Chris Lasher wrote: > Hello Pythonistas! > I'm looking for a way to duplicate entries in a symmetrical matrix > that's composed of genetic distances. For example, suppose I have a > matrix like the following: > > ABC > A 0.00 0.50 1.00 > B 0.50 0.00 0.50

Re: Duplicate entries in a matrix

2006-01-19 Thread Chris Lasher
Hey Gerard, Thanks for the suggestion! It took me a while to figure out how to get this to work. Two things were important: I needed to use the matrixmultiply() function, and the order of the two matrices being multiplied is critcial. Here's how I got the example to work. >>> from Numeric import

Re: Duplicate entries in a matrix

2006-01-18 Thread Gerard Flanagan
Chris Lasher wrote: > Hello Pythonistas! > I'm looking for a way to duplicate entries in a symmetrical matrix > that's composed of genetic distances. For example, suppose I have a > matrix like the following: > > ABC > A 0.00 0.50 1.00 > B 0.50 0.00 0.50