MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: List element replacement.

  • To: mathgroup at
  • Subject: [mg52063] Re: [mg51980] List element replacement.
  • From: János <janos.lobb at>
  • Date: Tue, 9 Nov 2004 01:36:57 -0500 (EST)
  • References: <>
  • Sender: owner-wri-mathgroup at

On Nov 6, 2004, at 2:07 AM, Robert G. Wilson v wrote:

> Et al,
> 	HELP, I tried this once before but what I received back I could not 
> make it work.
> Therefore I am following the adage that if at first you do not succeed 
> then wait
> awhile, rethink, restate and resubmit.
> 	I have three lists of objects, sorted but not unioned, that is there 
> are elements
> which will be repeated. Let us label them 'initial' list, 'compare' 
> list, and
> 'replace' list. If all of the elements in the 'compare' list, 
> including repeats,
> are in the 'initial' list, then remove those elements

remove from 'initial' or from 'compare' ?
>  and put in the elements from
> the 'replace' list.

put into 'initial' or 'compare' ?

You have to be more specific.

      #1]] & ) /@ comp

will give you a list indicating how many times an element from comp was 
found in init.

       #1]] & ) /@ comp, 0]

will give true if there was minimum one member of comp not in init.  If 
it gives false then all members of comp was in init so then you can go 
ahead with the replacements.

I hope it helps.

> Thank you in advance,
> Bob.
Trying to argue with a politician is like lifting up the head of a 
(S. Lem: His Master Voice)

  • Prev by Date: Re: Variance
  • Next by Date: Re: Mathematica Categorization - Humor
  • Previous by thread: Re: List element replacement.
  • Next by thread: Re: List element replacement.