This is an easy question but say I have an MxN matrix. All I want to do is extract specific columns and store them in another numpy array but I get invalid syntax errors. He
if you want to extract only some columns:
idx_IN_columns = [1, 9] extractedData = data[:,idx_IN_columns]
if you want to exclude specific columns:
idx_OUT_columns = [1, 9] idx_IN_columns = [i for i in xrange(np.shape(data)[1]) if i not in idx_OUT_columns] extractedData = data[:,idx_IN_columns]