I want to store a csv file in an array in python removing the first column. In order to store it I just write these 2 lines of code
from numpy import genfromtxt
def csvToArray():
data = genfromtxt('SP500Index.csv', delimiter=',')
return array
and it worked. From this point how can I get rid of the first column?
num_cols), then you can directly get the columns you want through thegenfromtextmethod:data = genfromtxt('SP500Index.csv', delimiter=',', usecols = range(1,num_cols)).