Mathematica 9 is now available
 Documentation / Mathematica / Built-in Functions / Lists and Matrices / Element Extraction  /
Drop

  • Drop[ list , n ] gives list with its first n elements dropped.
  • Drop[ list , - n ] gives list with its last n elements dropped.
  • Drop[ list , n ] gives list with its n element dropped.
  • Drop[ list , m , n ] gives list with elements m through n dropped.
  • Drop uses the standard sequence specification (see Section A.3.5).
  • Example: Drop[ a,b,c,d,e , 2].
  • Drop[ a,b,c,d,e , -3].
  • Drop can be used on an object with any head, not necessarily List.
  • See the Mathematica book: Section 1.8.4.
  • See also: Rest, StringDrop, Take, Cases.
  • Related package: LinearAlgebra`MatrixManipulation`.

    Further Examples

    This gives the list with the first element dropped

    In[1]:=

    Out[1]=

    This drops the last element.

    In[2]:=

    Out[2]=

    This drops the third through fifth elements from the list.

    In[3]:=

    Out[3]=



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.