How do you combine two split data back into original (numpy)
<p>I have a data named <code>Total</code> and I split it into features and labels as below. Later I split them into training and test data. </p>

<pre><code>Total_X = Total[:,:-1]
Total_y = Total[:,-1]

Train_X , Test_X , Train_y, Test_y = train_test_split(Total_X,Total_y,test_size = .3)
</code></pre>

<p>Now I want to combine <code>Train_X</code> and <code>Train_y</code> and create a new list which is like <code>Total</code>.</p>

<p>Are you sure you wanted to divide them in the first place?</p>

<pre><code>test_len = np.floor(len(Total) * 0.3)
test_xy, train_xy = Total[:test_len], Total[test_len:]
</code></pre>

<p>And then if you need them, you can extract <code>test_x = test_xy[:,:-1]</code> etc</p>

python numpy