title: Python arrays used as indices must be of integer (or boolean) type
body: <p>I'm using Pycharm to study Deep Learning. Yesterday I installed Pycharm and Tensorflow 2.1.0.
  Then I just type code from a book that I studied, and this error occurred.
  By Googling, I know the problem is that array must use integer not float.
  But in Jupyter Notebook, it doesn't occur. I don't know how to fix it..</p>
  
  <p>What should I do? Please Help me..</p>
  
  <pre><code>from tensorflow.keras.datasets import imdb
  import numpy as np
  
  (train_data, train_labels), (test_data, test_labels) = imdb.load_data(num_words = 10000)
  print(max([max(sequence) for sequence in train_data]))
  
  def vectorize_sequences(sequences, dimension = 10000):
      results = np.zeros((len(sequences), dimension), dtype=np.int32)
      for i, sequence in enumerate(sequences):
          results[i, sequences] = 1
  return results
  
  x_train = vectorize_sequences(train_data)
  x_test = vectorize_sequences(test_data)
  </code></pre>
  
  <p>and Traceback..</p>
  
  <pre><code>Traceback (most recent call last):
   File "C:/Users/ge971/PycharmProjects/Tensorflow_Example/keras.py", line 15, in &lt;module&gt;
      x_train = vectorize_sequences(train_data)
   File "C:/Users/ge971/PycharmProjects/Tensorflow_Example/keras.py", line 12, in vectorize_sequences
      results[i, sequences] = 1
  IndexError: arrays used as indices must be of integer (or boolean) type
  </code></pre>