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


Groups > comp.soft-sys.math.mathematica > #3169 > unrolled thread

Re: How to Do a Replacement with Two Conditions

Started byHeike Gramberg <heike.gramberg@gmail.com>
First post2011-06-17 10:09 +0000
Last post2011-06-17 10:09 +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.


Contents

  Re: How to Do a Replacement with Two Conditions Heike Gramberg <heike.gramberg@gmail.com> - 2011-06-17 10:09 +0000

#3169 — Re: How to Do a Replacement with Two Conditions

FromHeike Gramberg <heike.gramberg@gmail.com>
Date2011-06-17 10:09 +0000
SubjectRe: How to Do a Replacement with Two Conditions
Message-ID<itf94v$2eh$1@smc.vnet.net>
myList /. {x_ /; x > 180 -> 1, x_ /; x <= 180 -> 0}

Heike.

On 17 Jun 2011, at 05:07, Gregory Lypny wrote:

> Hello everyone,
>
> I have a list of integers and I want to replace numbers bigger than 
180 with one and those less than or equal to 180 with 0 to create a 
dummy variable.  The ones are easy:
>
> 	myList /. x_ /; x > 180 -> 1
>
> How do I get the zeros in there?
>
> Regards,
>
> Gregory
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web