[Numpy-discussion] loadtxt and usecols

Lorenzo Bolla lbolla@gmail....
Sat Jul 12 09:35:20 CDT 2008


why not using:
data = loadtxt('18B180.dat', skiprows = 1, usecols = xrange(1,46))

obviously, you need to know how many columns you have.
hth,
L.

On Sat, Jul 12, 2008 at 10:07:06AM -0400, Bryan Fodness wrote:
> i would like to load my data without knowing the length, i have explicitly
> stated the rows
> 
> data = loadtxt('18B180.dat', skiprows = 1, usecols =
> 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45))
> and would like to use something like,
> 
> data = loadtxt('18B180.dat', skiprows = 1, usecols = (1,:))
> 
> the first column is the only that i do not need.
> 
> -- 
> "The game of science can accurately be described as a never-ending insult to
> human intelligence." - João Magueijo
> 
> "Any intelligent fool can make things bigger, more complex, and more
> violent. It takes a touch of genius - and a lot of courage - to move in the
> opposite direction. " -Albert Einstein

> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion



More information about the Numpy-discussion mailing list