Coding question

DNN strategy trading code:

data=data.assign(Open=X1[:,0])

data=data.assign(High=X1[:,1])

data=data.assign(Low=X1[:,2])

data=data.assign(Close=X1[:,3])

data=data.assign(Volume=X2[:,0])

data.tail()



Why does X2 have to be assigned to index col=0 and yet it gets assigned to another index column>

Hi Sean,



The X2 is not being assigned. Instead, we take a slice from X2 and assign it to Volume. X2.shape gives (986,1) which means it is a 986 row, 1 column array. X2[:,0] takes all rows and 1st column slice and puts it in Volume.



Hope this helps!