title: fixing Missing values : ValueError: could not broadcast input array from shape
body: <p>Please I need help. am trying to fix the missing data but am getting an error message.</p>
  
  <pre><code>dataset_train = pd.read_csv("train_data.csv")
  dataset_test = pd.read_csv("test_data.csv")
  
  X_train = dataset_train.iloc[:, 1:11].values
  
  y_train = dataset_train.iloc[:, 13].values
  X_test = dataset_test.iloc[:, 1:11].values
  from sklearn.impute import SimpleImputer
  missingvalues = SimpleImputer(missing_values=np.nan, strategy="mean", verbose=0)
  missingvalues_train = missingvalues.fit(X_train[:,[7, 9]])
  X_train[:,1:11] =np.array(missingvalues_train.transform(X_train[:,[7,9]]))
  
  </code></pre>
  
  <p>This is the error message</p>
  
  <pre><code>X_train[:,1:11] =np.array(missingvalues_train.transform(X_train[:,[7,9]]))
  Traceback (most recent call last):
  
    File "&lt;ipython-input-15-b81359273b14&gt;", line 1, in &lt;module&gt;
      X_train[:,1:11] =np.array(missingvalues_train.transform(X_train[:,[7,9]]))
  
  ValueError: could not broadcast input array from shape (7160,2) into shape (7160,9)
  </code></pre>