I have a large table (numbers in text format) that I would like to load with numpy.genfromtxt(). I would like to ignore the first n columns, say 5. I do no
For older versions of numpy, peeking at the first line to discover the number of columns is not that hard:
import numpy as np
with open(fname, 'r') as f:
num_cols = len(f.readline().split())
f.seek(0)
data = np.genfromtxt(f, usecols = range(5,num_cols))
print(data)