Skip to content

Commit 5ebb8ad

Browse files
committed
ch11 py27 compatibility fixes
1 parent 7cb5808 commit 5ebb8ad

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

code/ch11/ch11.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@
396396
" c_silhouette_vals = silhouette_vals[y_km == c]\n",
397397
" c_silhouette_vals.sort()\n",
398398
" y_ax_upper += len(c_silhouette_vals)\n",
399-
" color = cm.jet(i / n_clusters)\n",
399+
" color = cm.jet(float(i) / n_clusters)\n",
400400
" plt.barh(range(y_ax_lower, y_ax_upper), c_silhouette_vals, height=1.0, \n",
401401
" edgecolor='none', color=color)\n",
402402
"\n",
@@ -499,7 +499,7 @@
499499
" c_silhouette_vals = silhouette_vals[y_km == c]\n",
500500
" c_silhouette_vals.sort()\n",
501501
" y_ax_upper += len(c_silhouette_vals)\n",
502-
" color = cm.jet(i / n_clusters)\n",
502+
" color = cm.jet(float(i) / n_clusters)\n",
503503
" plt.barh(range(y_ax_lower, y_ax_upper), c_silhouette_vals, height=1.0, \n",
504504
" edgecolor='none', color=color)\n",
505505
"\n",
@@ -1316,21 +1316,21 @@
13161316
],
13171317
"metadata": {
13181318
"kernelspec": {
1319-
"display_name": "Python 2",
1319+
"display_name": "Python 3",
13201320
"language": "python",
1321-
"name": "python2"
1321+
"name": "python3"
13221322
},
13231323
"language_info": {
13241324
"codemirror_mode": {
13251325
"name": "ipython",
1326-
"version": 2
1326+
"version": 3
13271327
},
13281328
"file_extension": ".py",
13291329
"mimetype": "text/x-python",
13301330
"name": "python",
13311331
"nbconvert_exporter": "python",
1332-
"pygments_lexer": "ipython2",
1333-
"version": "2.7.11"
1332+
"pygments_lexer": "ipython3",
1333+
"version": "3.5.1"
13341334
}
13351335
},
13361336
"nbformat": 4,

0 commit comments

Comments
 (0)