Mar-04-2017, 03:32 AM (This post was last modified: Mar-04-2017, 03:33 AM by raady07. Edited 4 times in total.)

I am new programmer to python.

I have a text file having 360 rows and 190 columns of data.

In matlab, if I load the text file and x_data will be variable of size 360x190 columns.

If I want to select 1 to 20 , 46 to 65, ... rows of data , I simply give

the resulting x_data_train will be the array of my desired.

How can do that in python ?

I have a text file having 360 rows and 190 columns of data.

In matlab, if I load the text file and x_data will be variable of size 360x190 columns.

If I want to select 1 to 20 , 46 to 65, ... rows of data , I simply give

`x_data_train = xdata([1:20,46:65,91:110,136:155,181:200,226:245,271:290,316:335], :);`

the resulting x_data_train will be the array of my desired.

How can do that in python ?

x_data = np.loadtxt('dataset_300mm.txt', unpack=True) x_data_train = [] x_data_train.append(x_data[1:20], x_data[46:65], x_data[91:110], x_data[136:155], x_data[181:200], x_data[226:245], x_data[271:290], x_data[316:335])if I do using append operation , the resultant of the array is strange , it is array of 8 subsets of array for 20*192, but I want it to be one array 160*192