Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*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 2004

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

Search the Archive

Re: selecting columns from a list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47880] Re: selecting columns from a list
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Thu, 29 Apr 2004 03:06:18 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 4/28/04 at 6:56 AM, eddoGrasho at edo.com (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

I can think of two quick methods to achieve what you want. First, there is

Drop[#,2]&/@data

Alternatively, there is

data[[All,Range[2,Length@First@data]]]

The second method assumes the data array is regular, i.e., each row has the same number of elements.

The first method only assumes there are more than 2 elements in each row.
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: selecting columns from a list
  • Next by Date: Re: mathematica 5.0 plot crashes
  • Previous by thread: Re: selecting columns from a list
  • Next by thread: Re: selecting columns from a list