diff --git a/notebooks/3-imdb.ipynb b/notebooks/3-imdb.ipynb index 8e95712d..29d17cff 100644 --- a/notebooks/3-imdb.ipynb +++ b/notebooks/3-imdb.ipynb @@ -173,7 +173,7 @@ "word_to_integer = tf.keras.datasets.imdb.get_word_index()\n", "\n", "# Print out the first ten keys in the dictionary\n", - "print(word_to_integer.keys()[0:10])\n", + "print(list(word_to_integer.keys())[0:10])\n", "\n", "integer_to_word = dict([(value, key) for (key, value) in word_to_integer.items()])\n", "\n", diff --git a/notebooks/4-reuters.ipynb b/notebooks/4-reuters.ipynb index 69ed4e08..7b13d75d 100644 --- a/notebooks/4-reuters.ipynb +++ b/notebooks/4-reuters.ipynb @@ -158,7 +158,7 @@ }, "cell_type": "code", "source": [ - "print(word_to_integer.keys()[0:10])\n", + "print(list(word_to_integer.keys())[0:10])\n", "\n", "integer_to_word = dict([(value, key) for (key, value) in word_to_integer.items()])\n", "\n",