Re: Transpose

2011-02-03 Thread Ken Wesson
On Thu, Feb 3, 2011 at 7:14 PM, Base wrote: > > Thank you Laurent and Ken.  Both great responses. > > What I was forgetting was that vector is a function of the index. > > This now makes total sense and I feel like a dummy for not getting > it.  Thanks for your responses. You're welcome. -- Yo

Re: Transpose

2011-02-03 Thread Base
Thank you Laurent and Ken. Both great responses. What I was forgetting was that vector is a function of the index. This now makes total sense and I feel like a dummy for not getting it. Thanks for your responses. On Feb 3, 3:44 pm, Laurent PETIT wrote: > 2011/2/3 Base : > > > > > > > Thats t

Re: Transpose

2011-02-03 Thread Robert McIntyre
That's a good one, on par with the one line low-pass filter: ;; filter noise ;;(http://clojure-log.n01se.net/date/2009-10-13.html by ambient ;;this is such a cool transform!!! (defn lo-pass [d coll] (reductions #(+ (* %2 d) (* %1 (- 1.0 d))) coll)) sincerely, --Robert McIntyre On Thu, Feb

Re: Transpose

2011-02-03 Thread Ken Wesson
On Thu, Feb 3, 2011 at 4:33 PM, Base wrote: > Thats the one! > > Now I just have to understand it... > > The first apply is throwing me a little. Start with (map foo [1 2 3] [4 5 6] [7 8 9]) That calls foo with the first elements of the collections (so, 1 4 7), then again with the second (2 5 8

Re: Transpose

2011-02-03 Thread Laurent PETIT
2011/2/3 Base : > Thats the one! > > Now I just have to understand it... > > The first apply is throwing me a little. > > > On Feb 3, 3:29 pm, Laurent PETIT wrote: >> Hello, >> >> 2011/2/3 Base : >> >> > Hi All - >> >> > I recall seeing a beautiful method for doing the following on this >> > site,

Re: Transpose

2011-02-03 Thread Base
Thats the one! Now I just have to understand it... The first apply is throwing me a little. On Feb 3, 3:29 pm, Laurent PETIT wrote: > Hello, > > 2011/2/3 Base : > > > Hi All - > > > I recall seeing a beautiful method for doing the following on this > > site, but cannot seem to find it > >

Re: Transpose

2011-02-03 Thread Laurent PETIT
Hello, 2011/2/3 Base : > Hi All - > > I recall seeing a beautiful method for doing the following on this > site, but cannot seem to find it > I would like to transform > > (def a [[1 2 3] >        [4 5 6] >        [7 8 9]]) > > to > > [[1 4 7] > [2 5 8] > [3 6 9]] user=> (vec (apply map vecto

Transpose

2011-02-03 Thread Base
Hi All - I recall seeing a beautiful method for doing the following on this site, but cannot seem to find it I would like to transform (def a [[1 2 3] [4 5 6] [7 8 9]]) to [[1 4 7] [2 5 8] [3 6 9]] Thanks -- You received this message because you are subscribed to the Goog

Re: Transpose and cast and max

2010-07-30 Thread Luka Stojanovic
"]["L" "5.4" "4.5"] ] I would like to create a vector that contains the max values of each of the second and third values from this vector in this case it would be: [5.4, 7.9] The method to do this that i have seen would be to 1. Transpose the vector using (apply

Re: Transpose and cast and max

2010-07-30 Thread Base
quot;4.2" "6.6"] ["L" "4.9" "7.9"] ["L" "1.1" > > "2.4"]["L" "5.4" "4.5"] > > ] > > > I would like to create a vector that contains the max values of each > > of the

Re: Transpose and cast and max

2010-07-30 Thread Steve Purcell
uot; > "2.4"]["L" "5.4" "4.5"] > ] > > I would like to create a vector that contains the max values of each > of the second and third values from this vector > > in this case it would be: [5.4, 7.9] > > The method to do this tha

Transpose and cast and max

2010-07-30 Thread Base
I would like to create a vector that contains the max values of each of the second and third values from this vector in this case it would be: [5.4, 7.9] The method to do this that i have seen would be to 1. Transpose the vector using (apply map vector v) 2. Discard the vector of Ms and