MathGroup Archive 2004

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

Search the Archive

Re: selecting columns from a list

  • To: mathgroup at
  • Subject: [mg47859] Re: [mg47844] selecting columns from a list
  • From: Sseziwa Mukasa <mukasa at>
  • Date: Thu, 29 Apr 2004 03:05:03 -0400 (EDT)
  • References: <>
  • Sender: owner-wri-mathgroup at

On Apr 28, 2004, at 6:56 AM, Edo wrote:

> Hello
> I just started with mathematica, wanted to load a comma separated data
> file and drop the first two columns. So I did
> data=Import["C:\Data\filename.ext","CSV"]; to get the file into a
> variable "data", then I am stuck, after doing some reading in the help
> files about Drop, Partition, Take.
>  etc
> could someone tell me what to read and where to find info about 
> indexing
> different data structures

There are a few ways to do this.  If you're data is in a nested list f 
two levels, then data[[All,Range[3,Last[Dimensions[data]]]]] represents 
data with the first two columns dropped.  The appropriate help topics 
to understand this are Part, Dimensions and Last.  Another expression 
of equivalent meaning is Drop[#,2]&/@data.  You need to understand what 
Map means to comprehend this expression.

Welcome to Mathematica.



  • Prev by Date: Newbie Newton Algorithm and extra precision digits
  • Next by Date: RE: Matrix Expansion question to Mathgroup
  • Previous by thread: Re: selecting columns from a list
  • Next by thread: selecting columns from a list