Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

Re: Length and Drop

  • To: mathgroup at smc.vnet.net
  • Subject: [mg32198] Re: [mg32183] Length and Drop
  • From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
  • Date: Sat, 5 Jan 2002 00:10:39 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Drop does not affect the original list, it constructs a new one. Your 
timexp remains unchanged:

In[23]:=
timexp={{0,0},{7,8}}

Out[23]=
{{0,0},{7,8}}

In[24]:=
Drop[timexp,1];timexp

Out[24]=
{{0,0},{7,8}}

Use

In[25]:=
timexp=Drop[timexp,1];timexp

Out[25]=
{{7,8}}

Andrzej Kozlowski

Toyama International University
JAPAN
http://platon.c.u-tokyo.ac.jp/andrzej/


On Friday, January 4, 2002, at 07:03  PM, Steve Gray wrote:

>     The following sequence seems wrong to  me, in that
> after dropping some elements from a list, its Length is
> still the same. I copied this directly from the notebook
> but removed the In[] and Out[] statements.
>
>
> timexp={{0,0}} -> {{0,0}}        [this is ok]
>
> timexp=Append[timexp,{7,8}] -> {{0,0},{7,8}}       [this is ok]
>
> Length[timexp] -> 2             [this is ok]
>
> Drop[timexp,1] -> {{7,8}}         [this is ok]
>
> Length[timexp] -> 2                    [ this is what I did not expect!]
>
>     Should not Drop reduce the Length of the list by the amount
> dropped?
>
>
>
>



  • Prev by Date: Re: Length and Drop
  • Next by Date: Re: Length and Drop
  • Previous by thread: Re: Length and Drop
  • Next by thread: Re: Length and Drop