title: how do i solve this problem of within class scatter matrix in LDA using python
body: <p>This is the section of the code i used  </p>
  
  <pre><code>SW = np.zeros((9,9))
      for i in range(1,9): #2 is number of classes
          per_class_sc_mat = np.zeros((9,9))
          for j in range(data[data["Class"]==i].shape[0]):
              row, mv = data.loc[j][:9].reshape(9,1), mean_vec[i]values.reshape(9,1)
      per_class_sc_mat += (row-mv).dot((row-mv).T)
      SW += per_class_sc_mat
      print('within-class Scatter Matrix:\n', SW)
      overall_mean = np.array(data.drop("lass", axis=1).mean())
  </code></pre>
  
  <p>showing these error</p>
  
  <pre><code>File "&lt;ipython-input-23-89f983069500&gt;", line 6
          row, mv = data.loc[j][:9].reshape(9,1), mean_vec[i]values.reshape(9,1)
                                                                  ^
      SyntaxError: invalid syntax
  </code></pre>