Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9415

Re: addRule

From Adriano Pascoletti <adriano.pascoletti@uniud.it>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: addRule
Date 2012-04-05 09:46 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jljplh$clp$1@smc.vnet.net> (permalink)
References <201204040831.EAA29999@smc.vnet.net>

Show all headers | View raw


In[1]:= Thread /@ Apply[Rule, {{1, {38, 35, 37}}, {2, {21}}, {3, {24,
14}}}, {1}]
Out[1]= {{1 -> 38, 1 -> 35, 1 -> 37}, {2 -> 21}, {3 -> 24, 3 -> 14}}


Adriano Pascoletti

2012/4/4 clansa <dauphinester@gmail.com>

> Hello,
> I have these data
> {{1, {38, 35, 37}}, {2, {21}}, {3, {24, 14}}}
> and I want
> {[1->38,1->35,1->37},{2->21},{3->24,3->14}}
> The solution is simple when list of data have the same length
> But what is the solution for my example
> Thanks
>
> Andrew
>
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: addRule Adriano Pascoletti <adriano.pascoletti@uniud.it> - 2012-04-05 09:46 +0000

csiph-web