Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #11381 > unrolled thread
| Started by | Tomas Garza <tgarza10@msn.com> |
|---|---|
| First post | 2012-08-16 06:07 +0000 |
| Last post | 2012-08-16 06:07 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: working with nested lists Tomas Garza <tgarza10@msn.com> - 2012-08-16 06:07 +0000
| From | Tomas Garza <tgarza10@msn.com> |
|---|---|
| Date | 2012-08-16 06:07 +0000 |
| Subject | Re: working with nested lists |
| Message-ID | <k0i2nj$1e4$1@smc.vnet.net> |
I wonder if this is what you want?
In[1]:= {#[[1]], #[[2]], -1/Sin[#[[1]]]} & /@ # & /@ myList
Out[1]= {{{-0.582155, 278.265, 1.81876}, {-0.584441, 155.871, 1.81247}, {-1.05854,
27.534, 1.14726}}, {{-0.670521, 148.054, 1.60929}, {-2.88281, 70.342,
3.90776}}}
-Tomas
> From: lemonlev@mac.com
> Subject: working with nested lists
> To: mathgroup@smc.vnet.net
> Date: Wed, 15 Aug 2012 03:34:26 -0400
>
> I'm trying to apply a transformation to a every element in a nested list. The issue is that each sub-list has a different length
>
> Example of the list:
> myList={{{-33.355 Degree, 278.265}, {-33.486 Degree,
> 155.871}, {-60.650 Degree, 27.534}},
> {{-38.418 Degree, 148.054}, {-165.173 Degree, 70.342}}};
>
> This is what I am trying and does not work:
> Do[
> Table[{myList[[k, i, 1]], myList[k, i, 2]] (-1)/Sin[myList[[k, i, 1]]]}, {i,
> Length[myList[[k]]]}], {k, Length[myList]}]
>
> Any tips?
>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web