title: How to convert a dictionary into an array
body: <p>I need to convert <code>labels_train</code> (which is a list of dictionaries <code>[{Id:0, Prediction:2},{Id:1, Prediction:4},....]</code>) for my classification model into an array.</p>
  
  <pre><code>#Classification model:
  from sklearn.linear_model import LogisticRegression
  class_model = LogisticRegression()
  
  #Fitting the classifier to the training set.
  classifier= class_model.fit(X_train_pca, labels_train)
  score= classifier.score(X_test_pca, labels_test)
  print(score)
  </code></pre>
  
  <p>When I run this codeThank you very much :) I get this error:</p>
  
  <pre><code>TypeError: unorderable types: dict()&gt;dict()
  </code></pre>
  
  <p><code>X_train_pca</code> is an array therefore I thought that I should convert the lables_train also into an array but I don't know how to do it since an array is different from a list.</p>