Fix hash() bug reported by Thiago

main
Aurélien Geron 2016-11-03 17:47:08 +01:00
parent 6714ec2979
commit dabda0f806
1 changed files with 2 additions and 2 deletions

View File

@ -235,7 +235,7 @@
"import hashlib\n",
"\n",
"def test_set_check(identifier, test_ratio, hash):\n",
" return hash(identifier).digest()[-1] < 256 * test_ratio\n",
" return hash(str(identifier).encode(\"ascii\")).digest()[-1] < 256 * test_ratio\n",
"\n",
"def split_train_test_by_id(data, test_ratio, id_column, hash=hashlib.md5):\n",
" ids = data[id_column]\n",
@ -1336,7 +1336,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.1"
"version": "3.5.2"
},
"nav_menu": {
"height": "279px",