Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5940
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!tudelft.nl!txtfeed1.tudelft.nl!feed.xsnews.nl!border-1.ams.xsnews.nl!newspump.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail |
|---|---|
| From | Ray Koopman <koopman@sfu.ca> |
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: simple question about removing elements from a table |
| Date | Thu, 27 Oct 2011 10:45:41 +0000 (UTC) |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Sender | steve@smc.vnet.net |
| Approved | Steven M. Christensen <steve@smc.vnet.net>, Moderator |
| Message-ID | <j8bcol$8ud$1@smc.vnet.net> (permalink) |
| References | <j89umn$2e$1@smc.vnet.net> |
| Lines | 22 |
| NNTP-Posting-Date | 27 Oct 2011 09:49:29 GMT |
| NNTP-Posting-Host | 7ed5b065.news.twtelecom.net |
| X-Trace | DXC=M5I81liBj9EP9kKlSEa7aEC_A=>8kQj6Mm^eQlV`f18GSkSnfSS@:cEEFiONJ7[GoFDQ@L5O=X5fL |
| X-Complaints-To | abuse@twtelecom.net |
| Xref | x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:5940 |
Show key headers only | View raw
On Oct 26, 2:39 pm, "Michael B. Heaney" <mhea...@gmail.com> wrote:
> Hi,
>
> I have a data table:
>
> data={{-0.5, 0.0321787}, {-0.489, 0.0321691}, {-0.478,
> 0.032211}, {-0.467, 0.0321723}, {-0.456, 0.0322448}, {-0.444, 0.0321498},
> {-0.433, 0.032132}, {-0.422, 0.0321804}, {-0.411, 0.0322158},
> {-0.4, 0.0320886}, {-0.233, 0.0320596}, {0.567, 0.00286087}, {0.578,
> -0.00143633}, {0.589, -0.00592979}, {0.6, -0.0113609}}
> I want to remove all of the elements that have a positive first number, to
> get:
>
> datasubset={{-0.5, 0.0321787}, {-0.489, 0.0321691}, {-0.478,
> 0.032211}, {-0.467, 0.0321723}, {-0.456, 0.0322448}, {-0.444, 0.0321498},
> {-0.433, 0.032132}, {-0.422, 0.0321804}, {-0.411, 0.0322158},
> {-0.4, 0.0320886}, {-0.233, 0.0320596}}
>
> How do I do this?
DeleteCases[data,{_?Positive,_}]
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
simple question about removing elements from a table "Michael B. Heaney" <mheaney@gmail.com> - 2011-10-26 21:39 +0000 Re: simple question about removing elements from a table Ray Koopman <koopman@sfu.ca> - 2011-10-27 10:45 +0000 Re: simple question about removing elements from a table "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-10-28 09:39 +0000
csiph-web