title: How can array be an index in python?
body: <p>I can't understand this line "<strong>results[i, sequence] = 1.</strong>"
  How can "sequence" be an index if it is an array, not number. Its shape in these 2 examples is (25000,). What actually occurs in this line?</p>
  
  <pre><code>from keras.datasets import imdb
  (train_data, train_labels), (test_data, test_labels) = imdb.load_data(
  num_words=10000)
  
  import numpy as np
  
  def vectorize_sequences(sequences, dimension = 10000):
      results = np.zeros((len(sequences), dimension))
      for i, sequence in enumerate(sequences):
          results[i, sequence] = 1.
      return results
  
  x_train = vectorize_sequences(train_data)
  x_test = vectorize_sequences(test_data)
  </code></pre>