title: Concatenate scaled columns
body: <p>I am trying to prepare data for the neural network. Below you can see data</p>
  <pre><code># load existing Iris dataset
  from sklearn.preprocessing import MinMaxScaler
  from sklearn import datasets
  iris = datasets.load_iris()
  
  # make a new dataframe
  df = pd.DataFrame(data=iris.data, columns=iris.feature_names)
  df['target'] = iris.target
  </code></pre>
  <p><a href="https://i.stack.imgur.com/SR7QK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SR7QK.png" alt="enter image description here" /></a></p>
  <p>After loading of data, I want to divide the data into test and training sets and after that perform normalization.</p>
  <p>I want <strong>to normalize only the first two columns</strong> (sepal length (cm)   and sepal width (cm)) with a min-max scaler, and after that to concatenate <strong>with last two columns</strong> ( petal length (cm) and petal width (cm)). After normalization data are converted into numpy.ndarray and I can't merge these four columns together.</p>
  <pre><code>np.random.seed(seed=1)
  
  train_data = df.sample(frac=0.8, random_state=0)
  test_data = df.drop(train_data.index)
  
  target_fields = ['target']
  
  X_train, Y_train = train_data.drop(target_fields, axis=1), train_data[target_fields]
  X_test, Y_test = test_data.drop(target_fields, axis=1), test_data[target_fields]
  
  # Min Max scaler
  scaler = MinMaxScaler(feature_range=(0, 1))
  
  X_train = scaler.fit_transform(X_train)
  X_test = scaler.fit_transform(X_test)
  
  Y_train = scaler.fit_transform(Y_train)
  Y_test = scaler.fit_transform(Y_test)
  </code></pre>
  <p>How to solve this problem?</p>