MathGroup Archive 2010

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

Search the Archive

Re: Deleting entries with zero in a table

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111562] Re: Deleting entries with zero in a table
  • From: prashanth <prash.mr at gmail.com>
  • Date: Thu, 5 Aug 2010 07:00:34 -0400 (EDT)
  • References: <i3bjin$20j$1@smc.vnet.net> <i3blv2$4vo$1@smc.vnet.net>

On Aug 4, 5:20 pm, Albert Retey <a... at gmx-topmail.de> wrote:
> Hi,
>
> > I have a table, where all the entries containing the integer "0" are
> > redundant, i.e. these entries must be removed. I cannot seem to find a
> > WHERE-command like the one in another system. Is there a smart way of doing
> > this in Mathematica?


You can use the following:
Select[table,Abs[#]>0&]
The Abs[#] takes care to not delete negative numbers that may be
present in your table. if sure that there are no negative numbers in
your table, you can use :
Select[table,#>0&]



  • Prev by Date: discussions on the language: For and Which
  • Next by Date: Format
  • Previous by thread: Re: Deleting entries with zero in a table
  • Next by thread: Re: Deleting entries with zero in a table