MathGroup Archive 2005

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

Search the Archive

Re: How to reverse sign on the y's in a list of (x, y)'s?


call your list l
then
#*{1, -1} & /@ l
or
{First[#], -Last[#]} & /@ l
or
l /. {a_, b_} -> {a, -b}
will do what you want
yehuda

On 10/13/05, sherifffruitfly at gmail.com <sherifffruitfly at gmail.com> wrote:
>
> Hi all,
>
> This is really dumb, but I just don't know how to do it...
>
> Import from excel gives me a list of ordered pairs, and I want the 2nd
> element of each pair to be of opposite sign. Sticking the negative sign
> in front of the entire Import statement reverses both the 1st and the
> 2nd elements (duh). How do I get just the second item to reverse sign?
>
> thanks!
>
>


  • Prev by Date: Re: Re: Language vs. Library why it matters
  • Next by Date: Re: why does this happen?
  • Previous by thread: Re: How to reverse sign on the y's in a list of (x, y)'s?
  • Next by thread: Re: How to reverse sign on the y's in a list of (x, y)'s?