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


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

How to Do a Replacement with Two Conditions

From Gregory Lypny <gregory.lypny@videotron.ca>
Newsgroups comp.soft-sys.math.mathematica
Subject How to Do a Replacement with Two Conditions
Date 2011-06-17 04:08 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <itejv3$s36$1@smc.vnet.net> (permalink)

Show all headers | View raw


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

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


Thread

How to Do a Replacement with Two Conditions Gregory Lypny <gregory.lypny@videotron.ca> - 2011-06-17 04:08 +0000
  Re: How to Do a Replacement with Two Conditions Ray Koopman <koopman@sfu.ca> - 2011-06-17 09:51 +0000
  Re: How to Do a Replacement with Two Conditions Peter Breitfeld <phbrf@t-online.de> - 2011-06-17 10:09 +0000
  Re: How to Do a Replacement with Two Conditions Dan <dflatin@rcn.com> - 2011-06-18 21:44 +0000

csiph-web