Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

Re: Problem with Position

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119644] Re: Problem with Position
  • From: Leonid Shifrin <lshifr at gmail.com>
  • Date: Thu, 16 Jun 2011 03:59:16 -0400 (EDT)
  • References: <201106151120.HAA22862@smc.vnet.net>

Hi Dominic,

This is most likely a symbolic/numerical issue. Position is based on
symbolic rather than numeric comparisons.
You may have success with

Flatten@Position[data[[All,1]],x_/;x==0.785398]

Here is one of the most recent related discussions:

http://stackoverflow.com/questions/5750623/using-position-correctly

Regards,
Leonid


On Wed, Jun 15, 2011 at 3:20 PM, Dominic W=F6rner <
dominic.woerner at mpi-hd.mpg.de> wrote:

> Hi,
>
> I have to import data from a csv file. And I get a structure
> data[[rows]]={first, second,...}.
> Now I want to find the rows in which, say the first entry has a specific
> values.
> By just looking at the data there are for example entries with value
> 0.785398.
> But when I try Flatten@Position[data[[All,1]],0.785398] or with
> ToString[0.785398] I just get {}
>
> What's the problem here?
>
> Best,
> Dominic
>
>


  • Prev by Date: remote kernel problems (LinkOpen::linke: MathLink linkname missing or malformed..)
  • Next by Date: Mathematica syntax problem: tsntxi
  • Previous by thread: Problem with Position
  • Next by thread: Re: Problem with Position