From listbox+trampoline+Q4+EFZ7+VpasClKV4RG7kdpmmgtVKA+BqUXUH@jeeves.archives.listbox.com  Thu May  3 14:59:46 2012
Received: from mx2.cims.nyu.edu (mx2.cims.nyu.edu [128.122.49.96])
	by mail.cims.nyu.edu (8.14.4+Sun/8.14.4) with ESMTP id q43Ixjgg015532
	for <shasha@mail.cims.nyu.edu>; Thu, 3 May 2012 14:59:45 -0400 (EDT)
Received: from b-lb-ob-quonix.listbox.com (b-lb-ob-quonix.listbox.com [208.72.237.5])
	by mx2.cims.nyu.edu (8.14.4+Sun/8.14.4) with ESMTP id q43IxJg8003199
	for <shasha@cs.nyu.edu>; Thu, 3 May 2012 14:59:19 -0400 (EDT)
Received: from b-lb-ex-sd.listbox.com (b-lb-ex-sd.listbox.com [74.115.168.26])
	by b-lb-ob-quonix.listbox.com (Postfix) with ESMTP id 32CA017C
	for <shasha@cs.nyu.edu>; Thu,  3 May 2012 14:59:19 -0400 (EDT)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by b-lb-ex-sd.listbox.com (Postfix) with ESMTP id 28516B32
	for <shasha@cs.nyu.edu>; Thu,  3 May 2012 14:59:19 -0400 (EDT)
Received: from a-lb-mx-quonix.listbox.com (a-lb-mx-quonix.listbox.com
 [208.72.237.28]) by a-lb-arc-quonix.listbox.com (Postfix) with ESMTP id
 7B3C84B98E for <k4@listbox.com.email.enqueue.archive.listbox.com>; Thu,  3
 May 2012 14:59:01 -0400 (EDT)
Received: from localhost.localdomain (localhost [127.0.0.1]) by
 a-lb-mx-quonix.listbox.com (Postfix) with ESMTP id 739866F9C for
 <k4@listbox.com.email.enqueue.archive.listbox.com>; Thu,  3 May 2012 14:59:01
 -0400 (EDT)
Received: from sz2.jpmchase.com (sz2.jpmchase.com [159.53.78.135]) by
 a-lb-mx-quonix.listbox.com (Postfix) with ESMTP id 259866F9A for
 <k4@listbox.com>; Thu,  3 May 2012 14:58:58 -0400 (EDT)
Received: from se2.svr.bankone.net (se2.svr.bankone.net [155.180.234.120]) by
 sz2.jpmchase.com (Switch-3.4.4/Switch-3.3.3mp) with ESMTP id q43IwvbQ013670
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for
 <k4@listbox.com>; Thu, 3 May 2012 14:58:57 -0400
X-DKIM: OpenDKIM Filter v2.1.3 sz2.jpmchase.com q43IwvbQ013670
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpmorgan.com;
 s=smtpout; t=1336071537; bh=vVkNflJj/CCl1LYu2kl5cRbZfEWNQOd+oc1PqEu8huA=;
 h=From:To:Subject:Date:Message-ID:References:In-Reply-To:
 MIME-Version:Content-Type;
 b=Jq6nvutDxzStnFO5Uw6LMCQvRI3IB9QjzfbN/VqIpMrsW7TXHIil9HCrOLwCl7mP7
 Pqp7YvNALj6jT8CJf9FrP5MriT1u45nvN/eRJabnd7QGtLaduqLLM1c6qhDZELANqx
 a1YXIdAQ0DVBGuhtGT5N3nzZ5WzzEt41lgQkCPhg=
Received: from svr.bankone.net ([169.111.247.232]) by se2.svr.bankone.net
 (Switch-3.4.4/Switch-3.4.3) with ESMTP id q43IwuvZ001738 (version=TLSv1/SSLv3
 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for <k4@listbox.com>; Thu, 3
 May 2012 14:58:57 -0400
Received: from ([155.180.52.17]) by imf2.svr.bankone.net with ESMTP  id
 F0Z0FN1.54688883; Thu, 03 May 2012 14:58:10 -0400
Received: from HUBCR106.exchad.jpmchase.net (169.70.184.124) by
 HUBR001.exchad.jpmchase.net (169.70.190.48) with Microsoft SMTP Server (TLS)
 id 8.3.159.2; Thu, 3 May 2012 14:58:48 -0400
Received: from SCACDI002.exchad.jpmchase.net (169.83.186.238) by
 HUBCR106.exchad.jpmchase.net (169.70.184.124) with Microsoft SMTP Server
 (TLS) id 8.3.159.2; Thu, 3 May 2012 14:58:48 -0400
Received: from SCACMX002.exchad.jpmchase.net ([169.254.2.240]) by
 SCACDI002.exchad.jpmchase.net ([169.83.186.238]) with mapi id 14.01.0355.002;
 Thu, 3 May 2012 14:58:48 -0400
From: "Wolrich, Samuel G" <samuel.g.wolrich@jpmorgan.com>
To: "k4" <k4@listbox.com>
Subject: [k4] RE: Help on using functions on tables with list columns?
Thread-Topic: Help on using functions on tables with list columns?
Thread-Index: Ac0pT8SqEnliNQaGQpWsvgjgvu9rVgABeJfgAAIh7cA=
Date: Thu, 3 May 2012 18:58:47 +0000
Message-ID:
 <159FA9D6AACBCC4087337C16FB2C11B71007C73C@SCACMX002.exchad.jpmchase.net>
References:
 <159FA9D6AACBCC4087337C16FB2C11B71007C697@SCACMX002.exchad.jpmchase.net>
 <505553C26D3D1141851230DBE8601A8A01654E37B746@NYWEXMBX2127.msad.ms.com>
In-Reply-To:
 <505553C26D3D1141851230DBE8601A8A01654E37B746@NYWEXMBX2127.msad.ms.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.83.36.55]
MIME-Version: 1.0
X-DLP-FWD: Yes
Content-Type: multipart/alternative; boundary="_000_159FA9D6AACBCC4087337C16FB2C11B71007C73CSCACMX002exchad_"
Reply-To: k4@listbox.com
List-ID: <k4@listbox.com>
X-Listbox-List-ID: 1080 <k4@listbox.com>
List-Software: listbox.com v2.0
List-Help: <http://www.listbox.com/subscription-help.html>
Precedence: list
List-Unsubscribe: <mailto:unsubscribe-k4@listbox.com>,
 <https://www.listbox.com/unsubscribe/?member_id=901033&id_secret=901033-6a517507&post_id=20120503145906:0AAC9656-9552-11E1-BB91-DA669A0B5528>
List-Subscribe: <mailto:subscribe-k4@listbox.com>,
 <http://www.listbox.com/subscribe/?list_id=1080>
X-Listbox-Post-Id: 20120503145906:0AAC9656-9552-11E1-BB91-DA669A0B5528
X-Listbox-Original-Sender: "Wolrich, Samuel G"
 <samuel.g.wolrich@jpmorgan.com>
Errors-To:  listbox+trampoline+Q4+EFZ7+VpasClKV4RG7kdpmmgtVKA+BqUXUH@jeeves.archives.listbox.com
X-Scanned-By: MIMEDefang 2.73 on 128.122.49.96
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (mx2.cims.nyu.edu [128.122.49.96]); Thu, 03 May 2012 14:59:45 -0400 (EDT)
Status: RO
Content-Length: 24441


--_000_159FA9D6AACBCC4087337C16FB2C11B71007C73CSCACMX002exchad_
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Yes - thank you Mike (and everyone else with good suggestions), this works.=
=0D
=0D
As usual, humbled by the simplicity of q...=0D
=0D
Sam=0D
=0D
From: Rosenberg, Michael K [mailto:Mike.Rosenberg@morganstanley.com]=0D
Sent: Thursday, May 03, 2012 1:55 PM=0D
To: k4=0D
Subject: [k4] RE: Help on using functions on tables with list columns?=0D
=0D
is this a fair approximation of what you are trying to do? (apologies if no=
t).=0D
=0D
q)t:([]a:(1 2 3;4 5;6 7 8 9);b:(10 20 30;40 50;60 70 80 90);c:(100 200 300;=
400 500;600 700 800 900))=0D
q)t=0D
a       b           c=0D
-----------------------------------=0D
1 2 3   10 20 30    100 200 300=0D
4 5     40 50       400 500=0D
6 7 8 9 60 70 80 90 600 700 800 900=0D
q)foo:{x+y+z}=0D
q)update t:foo'[a;b;c] from t=0D
a       b           c               t=0D
---------------------------------------------------=0D
1 2 3   10 20 30    100 200 300     111 222 333=0D
4 5     40 50       400 500         444 555=0D
6 7 8 9 60 70 80 90 600 700 800 900 666 777 888 999=0D
q)=0D
=0D
mike=0D
=0D
From: Wolrich, Samuel G [mailto:samuel.g.wolrich@jpmorgan.com]=0D
Sent: Thursday, May 03, 2012 1:11 PM=0D
To: k4=0D
Subject: [k4] Help on using functions on tables with list columns?=0D
=0D
I'm trying to figure out how to apply a function to three or more columns o=
f a table, where the column values are lists, and I'm getting stuck - any s=
uggestions?=0D
=0D
For example, suppose I generate the table=0D
=0D
x_grid:((1 2 3 4 5f);(6 7 8f);(9 10 11 12 13 14f));=0D
y_grid:x_grid*x_grid;=0D
test_pts:((2.5 6.4 -1.0 4.4);(5.5 8.6 6.6 7.5);(9.4));=0D
t:([] x_grid:x_grid; y_grid:y_grid; test_pts:test_pts);=0D
=0D
x_grid                      y_grid                                   test_p=
ts=0D
---------------------------------------------------------=0D
1 2 3 4 5f                  1 4 9 16 25f                         2.5 6.4 -1=
 4.4=0D
6 7 8f                        36 49 64f                               5.5 8=
.6 6.6 7.5=0D
9 10 11 12 13 14f   81 100 121 144 169 196f  9.4=0D
=0D
I then want to apply a function in the usual way that returns a list (in th=
is case, a linear interpolation) with the same size of test_pts, e.g. updat=
e interpPts:linearInterpolate[test_pts; x_grid; y_grid] from `t. I can't ra=
ze and reshape by cutting, because then I end up mixing the grid points. I =
also tried just applying the monadic identity (::) with each to the columns=
, to no avail (get a 'length error).=0D
If anyone knows how to do this or more generally apply triadic functions to=
 columns of lists, definitely would appreciate the help.=0D
=0D
Thanks - Sam=0D
=0D
=0D
Samuel Wolrich=0D
Associate, Linear Quantitative Research | Global Equities=0D
J.P. Morgan | 383 Madison Avenue, 6th Floor, New York, NY 10179=0D
T: (212) 622-8072 | e-mail: samuel.g.wolrich@jpmorgan.com<mailto:samuel.g.w=
olrich@jpmorgan.com>=0D
=0D
k4 | Modify<https://www.listbox.com/member/?&> Your Subscription=0D
=0D
=0D
This email is confidential and subject to important disclaimers and conditi=
ons including on offers for the purchase or sale of securities, accuracy an=
d completeness of information, viruses, confidentiality, legal privilege, a=
nd legal entity disclaimers, available at http://www.jpmorgan.com/pages/dis=
closures/email.=0D
=0D
________________________________=0D
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinion=
s or views contained herein are not intended to be, and do not constitute, =
advice within the meaning of Section 975 of the Dodd-Frank Wall Street Refo=
rm and Consumer Protection Act. If you have received this communication in =
error, please destroy all electronic and paper copies and notify the sender=
 immediately. Mistransmission is not intended to waive confidentiality or p=
rivilege. Morgan Stanley reserves the right, to the extent permitted under =
applicable law, to monitor electronic communications. This message is subje=
ct to terms available at the following link: http://www.morganstanley.com/d=
isclaimers. If you cannot access these links, please notify us by reply mes=
sage and we will send the contents to you. By messaging with Morgan Stanley=
 you consent to the foregoing.=0D
k4 | Modify<https://www.listbox.com/member/?&> Your Subscription=0D
=0D
=0D
=0D



-------------------------------------------
k4
Modify Your Subscription: https://www.listbox.com/member/?member_id=3D90103=
3&id_secret=3D901033-670b4995

--_000_159FA9D6AACBCC4087337C16FB2C11B71007C73CSCACMX002exchad_
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">=0D
<head>=0D
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>=0D
<meta name=3D"Generator" content=3D"Microsoft Word 12 (filtered medium)">=
=0D
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}=0D
o\:* {behavior:url(#default#VML);}=0D
w\:* {behavior:url(#default#VML);}=0D
.shape {behavior:url(#default#VML);}=0D
</style><![endif]--><style><!--=0D
/* Font Definitions */=0D
@font-face=0D
	{font-family:Helvetica;=0D
	panose-1:2 11 6 4 2 2 2 3 2 4;}=0D
@font-face=0D
	{font-family:"Cambria Math";=0D
	panose-1:2 4 5 3 5 4 6 3 2 4;}=0D
@font-face=0D
	{font-family:Calibri;=0D
	panose-1:2 15 5 2 2 2 4 3 2 4;}=0D
@font-face=0D
	{font-family:Tahoma;=0D
	panose-1:2 11 6 4 3 5 4 4 2 4;}=0D
@font-face=0D
	{font-family:Verdana;=0D
	panose-1:2 11 6 4 3 5 4 4 2 4;}=0D
/* Style Definitions */=0D
p.MsoNormal, li.MsoNormal, div.MsoNormal=0D
	{margin:0in;=0D
	margin-bottom:.0001pt;=0D
	font-size:11.0pt;=0D
	font-family:"Calibri","sans-serif";}=0D
a:link, span.MsoHyperlink=0D
	{mso-style-priority:99;=0D
	color:blue;=0D
	text-decoration:underline;}=0D
a:visited, span.MsoHyperlinkFollowed=0D
	{mso-style-priority:99;=0D
	color:purple;=0D
	text-decoration:underline;}=0D
p=0D
	{mso-style-priority:99;=0D
	mso-margin-top-alt:auto;=0D
	margin-right:0in;=0D
	mso-margin-bottom-alt:auto;=0D
	margin-left:0in;=0D
	font-size:12.0pt;=0D
	font-family:"Times New Roman","serif";}=0D
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate=0D
	{mso-style-priority:99;=0D
	mso-style-link:"Balloon Text Char";=0D
	margin:0in;=0D
	margin-bottom:.0001pt;=0D
	font-size:8.0pt;=0D
	font-family:"Tahoma","sans-serif";}=0D
span.EmailStyle18=0D
	{mso-style-type:personal;=0D
	font-family:"Calibri","sans-serif";=0D
	color:windowtext;}=0D
span.EmailStyle19=0D
	{mso-style-type:personal;=0D
	font-family:"Arial","sans-serif";=0D
	color:windowtext;}=0D
span.BalloonTextChar=0D
	{mso-style-name:"Balloon Text Char";=0D
	mso-style-priority:99;=0D
	mso-style-link:"Balloon Text";=0D
	font-family:"Tahoma","sans-serif";}=0D
span.EmailStyle23=0D
	{mso-style-type:personal-reply;=0D
	font-family:"Calibri","sans-serif";=0D
	color:#1F497D;}=0D
.MsoChpDefault=0D
	{mso-style-type:export-only;=0D
	font-size:10.0pt;}=0D
@page WordSection1=0D
	{size:8.5in 11.0in;=0D
	margin:1.0in 1.0in 1.0in 1.0in;}=0D
div.WordSection1=0D
	{page:WordSection1;}=0D
--></style><!--[if gte mso 9]><xml>=0D
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />=0D
</xml><![endif]--><!--[if gte mso 9]><xml>=0D
<o:shapelayout v:ext=3D"edit">=0D
<o:idmap v:ext=3D"edit" data=3D"1" />=0D
</o:shapelayout></xml><![endif]-->=0D
</head>=0D
<body lang=3D"EN-US" link=3D"blue" vlink=3D"purple">=0D
<div class=3D"WordSection1">=0D
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">Yes &#8211; thank you =
Mike (and everyone else with good suggestions), this works.<o:p></o:p></spa=
n></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">As usual, humbled by t=
he simplicity of q&#8230;<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">Sam<o:p></o:p></span><=
/p>=0D
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p></o:p></span></p>=
=0D
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>=0D
<div>=0D
<div style=3D"border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in =
0in 0in">=0D
<p class=3D"MsoNormal"><b><span style=3D"font-size:10.0pt;font-family:&quot=
;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style=3D"font-s=
ize:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> Rosenber=
g, Michael K [mailto:Mike.Rosenberg@morganstanley.com]=0D
<br>=0D
<b>Sent:</b> Thursday, May 03, 2012 1:55 PM<br>=0D
<b>To:</b> k4<br>=0D
<b>Subject:</b> [k4] RE: Help on using functions on tables with list column=
s?<o:p></o:p></span></p>=0D
</div>=0D
</div>=0D
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>=0D
<div>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Arial&quot;,&quot;s=
ans-serif&quot;;color:black">is this a fair approximation of what you are t=
rying to do? (apologies if not).<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Arial&quot;,&quot;s=
ans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">q)t:([]a:(1 2 3;4 5;6 7 8 9);b:(10 20 30;40 50;60 70 80 90);c:(=
100 200 300;400 500;600 700 800 900))<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">q)t<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">-----------------------------------<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">1 2 3&nbsp;&nbsp; 10 20 30&nbsp;&nbsp;&nbsp; 100 200 300<o:p></=
o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">4 5&nbsp;&nbsp;&nbsp;&nbsp; 40 50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp; 400 500<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">6 7 8 9 60 70 80 90 600 700 800 900<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">q)foo:{x&#43;y&#43;z}<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">q)update t:foo'[a;b;c] from t<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">---------------------------------------------------<o:p></o:p><=
/span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">1 2 3&nbsp;&nbsp; 10 20 30&nbsp;&nbsp;&nbsp; 100 200 300&nbsp;&=
nbsp;&nbsp;&nbsp; 111 222 333<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">4 5&nbsp;&nbsp;&nbsp;&nbsp; 40 50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp; 400 500&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 444 555<o:p>=
</o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">6 7 8 9 60 70 80 90 600 700 800 900 666 777 888 999<o:p></o:p><=
/span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:black">q)<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Arial&quot;,&quot;s=
ans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Arial&quot;,&quot;s=
ans-serif&quot;;color:black">mike<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Arial&quot;,&quot;s=
ans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>=0D
<div>=0D
<div style=3D"border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in =
0in 0in">=0D
<p class=3D"MsoNormal"><b><span style=3D"font-size:10.0pt;font-family:&quot=
;Tahoma&quot;,&quot;sans-serif&quot;;color:black">From:</span></b><span sty=
le=3D"font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot=
;;color:black"> Wolrich, Samuel G [<a href=3D"mailto:samuel.g.wolrich@jpmor=
gan.com">mailto:samuel.g.wolrich@jpmorgan.com</a>]=0D
<br>=0D
<b>Sent:</b> Thursday, May 03, 2012 1:11 PM<br>=0D
<b>To:</b> k4<br>=0D
<b>Subject:</b> [k4] Help on using functions on tables with list columns?<o=
:p></o:p></span></p>=0D
</div>=0D
</div>=0D
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black">I&#8217;m trying to figu=
re out how to apply a function to three or more columns of a table, where t=
he column values are lists, and I&#8217;m getting stuck &#8211; any suggest=
ions?<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black">For example, suppose I g=
enerate the table=0D
<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>=0D
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:9.0pt;font-family:&quot;Courier New&quot;;color:black">x_grid:((1 2 3 4 =
5f);(6 7 8f);(9 10 11 12 13 14f));<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:9.0pt;font-family:&quot;Courier New&quot;;color:black">y_grid:x_grid*x_g=
rid;<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:9.0pt;font-family:&quot;Courier New&quot;;color:black">test_pts:((2.5 6.=
4 -1.0 4.4);(5.5 8.6 6.6 7.5);(9.4));<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-size:9.0pt;font-family:&quot;Cou=
rier New&quot;;color:black">t:([] x_grid:x_grid; y_grid:y_grid; test_pts:te=
st_pts);<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"font-size:9.0pt;font-family:&quot;Cou=
rier New&quot;;color:black"><o:p>&nbsp;</o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black">x_grid&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y_grid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;test_pts<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black">------------------------=
---------------------------------<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black">1 2 3 4 5f&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;1 4 9 16 25f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;2.5 6.4 -1 4.4<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black">6 7 8f&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;36 49 64f&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;5.5 8.6 6.6 7.5<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black">9 10 11 12 13 14f &nbsp;=
&nbsp;81 100 121 144 169 196f &nbsp;9.4<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black">I then want to apply a f=
unction in the usual way that returns a list (in this case, a linear interp=
olation) with the same size of=0D
<i>test_pts</i>, e.g. <i>update interpPts:linearInterpolate[test_pts; x_gri=
d; y_grid] from `t</i>. I can&#8217;t raze and reshape by cutting, because =
then I end up mixing the grid points. I also tried just applying the monadi=
c identity (::) with=0D
<i>each</i> to the columns, to no avail (get a &#8216;length error). <o:p><=
/o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black">If anyone knows how to d=
o this or more generally apply triadic functions to columns of lists, defin=
itely would appreciate the help.<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black">Thanks &#8211; Sam<o:p><=
/o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>=0D
<p class=3D"MsoNormal" style=3D"line-height:12.0pt;text-autospace:none"><b>=
<span style=3D"font-size:8.0pt;font-family:&quot;Verdana&quot;,&quot;sans-s=
erif&quot;;color:#4D4D4D">Samuel Wolrich</span></b><span style=3D"font-size=
:8.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#4D4D4D=
"><o:p></o:p></span></p>=0D
<p class=3D"MsoNormal" style=3D"line-height:12.0pt;text-autospace:none"><sp=
an style=3D"font-size:8.0pt;font-family:&quot;Verdana&quot;,&quot;sans-seri=
f&quot;;color:#4D4D4D">Associate, Linear Quantitative Research | Global Equ=
ities<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal" style=3D"line-height:12.0pt;text-autospace:none"><sp=
an style=3D"font-size:8.0pt;font-family:&quot;Verdana&quot;,&quot;sans-seri=
f&quot;;color:#4D4D4D">J.P. Morgan | 383 Madison Avenue, 6th Floor, New Yor=
k, NY 10179<o:p></o:p></span></p>=0D
<p class=3D"MsoNormal" style=3D"line-height:12.0pt;text-autospace:none"><sp=
an style=3D"font-size:8.0pt;font-family:&quot;Verdana&quot;,&quot;sans-seri=
f&quot;;color:#4D4D4D">T: (212) 622-8072 | e-mail:=0D
<a href=3D"mailto:samuel.g.wolrich@jpmorgan.com">samuel.g.wolrich@jpmorgan.=
com</a><o:p></o:p></span></p>=0D
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>=0D
<div style=3D"border:none;border-top:solid #CCCCCC 1.0pt;padding:4.0pt 0in =
0in 0in">=0D
<table class=3D"MsoNormalTable" border=3D"0" cellspacing=3D"0" cellpadding=
=3D"0" width=3D"100%" style=3D"width:100.0%;background:white">=0D
<tbody>=0D
<tr>=0D
<td style=3D"padding:0in 0in 0in 0in">=0D
<p class=3D"MsoNormal"><strong><span style=3D"font-size:7.5pt;font-family:&=
quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#333333">k4</span></stron=
g><span style=3D"font-size:7.5pt;font-family:&quot;Helvetica&quot;,&quot;sa=
ns-serif&quot;;color:#333333"> |=0D
<a href=3D"https://www.listbox.com/member/?&amp;" title=3D""><span style=3D=
"color:#669933;text-decoration:none">Modify</span></a> Your Subscription=0D
</span><span style=3D"font-size:12.0pt;font-family:&quot;Times New Roman&qu=
ot;,&quot;serif&quot;"><o:p></o:p></span></p>=0D
</td>=0D
</tr>=0D
</tbody>=0D
</table>=0D
</div>=0D
<p><span style=3D"color:black;background:white">This email is confidential =
and subject to important disclaimers and conditions including on offers for=
 the purchase or sale of securities, accuracy and completeness of informati=
on, viruses, confidentiality, legal=0D
 privilege, and legal entity disclaimers, available at <a href=3D"http://ww=
w.jpmorgan.com/pages/disclosures/email">=0D
http://www.jpmorgan.com/pages/disclosures/email</a>. </span><span style=3D"=
color:black"><o:p></o:p></span></p>=0D
</div>=0D
<div>=0D
<div class=3D"MsoNormal" align=3D"center" style=3D"text-align:center"><span=
 style=3D"font-size:7.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&qu=
ot;;color:black">=0D
<hr size=3D"2" width=3D"100%" align=3D"center">=0D
</span></div>=0D
</div>=0D
<div>=0D
<p class=3D"MsoNormal"><span style=3D"font-size:7.5pt;font-family:&quot;Ari=
al&quot;,&quot;sans-serif&quot;;color:gray">NOTICE:=0D
</span><span lang=3D"EN-GB" style=3D"font-size:7.5pt;font-family:&quot;Aria=
l&quot;,&quot;sans-serif&quot;;color:gray">Morgan Stanley is not acting as =
a municipal advisor and the opinions or views contained herein are not inte=
nded to be, and do not constitute, advice within the meaning=0D
 of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protectio=
n Act.=0D
</span><span style=3D"font-size:7.5pt;font-family:&quot;Arial&quot;,&quot;s=
ans-serif&quot;;color:gray">If you have received this communication in erro=
r, please destroy all electronic and paper copies and notify the sender imm=
ediately. Mistransmission is not intended to waive confidentiality=0D
 or privilege. Morgan Stanley reserves the right, to the extent permitted u=
nder applicable law, to monitor electronic communications. This message is =
subject to terms available at the following link:=0D
</span><span style=3D"font-size:14.0pt;font-family:&quot;Arial&quot;,&quot;=
sans-serif&quot;;color:gray"><a href=3D"http://www.morganstanley.com/discla=
imers"><span style=3D"font-size:7.5pt;color:gray">http://www.morganstanley.=
com/disclaimers</span></a></span><span style=3D"font-size:7.5pt;font-family=
:&quot;Arial&quot;,&quot;sans-serif&quot;;color:gray">.=0D
 If you cannot access these links, please notify us by reply message and we=
 will send the contents to you. By messaging with Morgan Stanley you consen=
t to the foregoing.</span><span style=3D"font-size:12.0pt;font-family:&quot=
;Times New Roman&quot;,&quot;serif&quot;"><o:p></o:p></span></p>=0D
</div>=0D
<div style=3D"border:none;border-top:solid #CCCCCC 1.0pt;padding:4.0pt 0in =
0in 0in">=0D
<table class=3D"MsoNormalTable" border=3D"0" cellspacing=3D"0" cellpadding=
=3D"0" width=3D"100%" style=3D"width:100.0%;background:white">=0D
<tbody>=0D
<tr>=0D
<td style=3D"padding:0in 0in 0in 0in">=0D
<p class=3D"MsoNormal"><strong><span style=3D"font-size:7.5pt;font-family:&=
quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#333333">k4</span></stron=
g><span style=3D"font-size:7.5pt;font-family:&quot;Helvetica&quot;,&quot;sa=
ns-serif&quot;;color:#333333"> |=0D
<a href=3D"https://www.listbox.com/member/?&amp;" title=3D"">=0D
<span style=3D"color:#669933;text-decoration:none">Modify</span></a> Your S=
ubscription=0D
</span><span style=3D"font-size:12.0pt;font-family:&quot;Times New Roman&qu=
ot;,&quot;serif&quot;"><o:p></o:p></span></p>=0D
</td>=0D
</tr>=0D
</tbody>=0D
</table>=0D
<p class=3D"MsoNormal"><span style=3D"font-size:12.0pt;font-family:&quot;Ti=
mes New Roman&quot;,&quot;serif&quot;"><o:p>&nbsp;</o:p></span></p>=0D
</div>=0D
</div>=0D
<div style=3D"width:auto;margin:0;padding:5px;background-color:#fff;clear:b=
oth;border-top: 1px solid #ccc;" bgcolor=3D"#ffffff">

<table border=3D"0" cellspacing=3D"0" cellpadding=3D"0" width=3D"100%" styl=
e=3D"background-color:#fff" bgcolor=3D"#ffffff">
  <tr>
    <td padding=3D"4px">
      <font color=3D"#333333" size=3D"1" style=3D"font-family:helvetica, sa=
ns-serif;">
      <strong>k4</strong> | <a style=3D"text-decoration:none;color:#669933;=
border-bottom: 1px solid #444444"
href=3D"https://www.listbox.com/member/?member_id=3D901033&id_secret=3D9010=
33-670b4995" title=3D"">Modify</a>
 Your Subscription
      </font>
    </td>
  </tr>
</table>
</div>
</body>=0D
</html>=0D
=0D
<p><span STYLE=3D"color :#000000;background-color :#FFFFFF">=0D
This email is confidential and subject to important disclaimers and conditi=
ons including on offers for the purchase or sale of securities, accuracy an=
d completeness of information, viruses, confidentiality, legal privilege, a=
nd legal entity disclaimers, available at http://www.jpmorgan.com/pages/dis=
closures/email.  =0D
</span></p>=

--_000_159FA9D6AACBCC4087337C16FB2C11B71007C73CSCACMX002exchad_--

