Re: Replacing 1 to many in a list

• To: mathgroup at smc.vnet.net
• Subject: [mg29278] Re: Replacing 1 to many in a list
• From: "Stephen P Luttrell" <luttrell at signal.dra.hmg.gb>
• Date: Sat, 9 Jun 2001 03:09:06 -0400 (EDT)
• References: <9fq1sf\$qdl\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```This does what you want:

vector = {6, 6, 5, 4, 4, 4, Null, 6, Null, 44, Null, 4, 4, 5};

pos = Position[vector, Null];

MapIndexed[(vector[[#[[1]]]] = x[#2[[1]]]) &, pos];

vector

--
Stephen P Luttrell
DERA Malvern, U.K.

"Chris Johnson" <cjohnson at shell.faradic.net> wrote in message
news:9fq1sf\$qdl\$1 at smc.vnet.net...
> I think this is probably simple, but I can't find a natural way to do it
> yet.  I hope someone out there can help.  I have a vector numbers with
> some Null's scattered throughout.  The number and location of missing data
> varies.  For example,
>
> vector = {6, 6, 5, 4, 4, 4, Null, 6, Null, 44, Null, 4, 4, 5}
>
> Position[vector, Null]
>
> {{7}, {9}, {11}}
>...

```

• Prev by Date: integrals involving vectors and matrices
• Next by Date: Re: Fourth degree polynomial
• Previous by thread: Re: Replacing 1 to many in a list
• Next by thread: Re: Replacing 1 to many in a list