Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

Commit

Permalink
Merge pull request #26 from pmontelo/python3_compat
Browse files Browse the repository at this point in the history
Fix for "TypeError: 'dict_keys' object is not subscriptable" error wh…
  • Loading branch information
Amit Patankar authored May 16, 2018
2 parents cac3d9e + 18a2938 commit 9c12c94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion notebooks/3-imdb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/4-reuters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9c12c94

Please sign in to comment.