|
396 | 396 | " c_silhouette_vals = silhouette_vals[y_km == c]\n", |
397 | 397 | " c_silhouette_vals.sort()\n", |
398 | 398 | " 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", |
400 | 400 | " plt.barh(range(y_ax_lower, y_ax_upper), c_silhouette_vals, height=1.0, \n", |
401 | 401 | " edgecolor='none', color=color)\n", |
402 | 402 | "\n", |
|
499 | 499 | " c_silhouette_vals = silhouette_vals[y_km == c]\n", |
500 | 500 | " c_silhouette_vals.sort()\n", |
501 | 501 | " 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", |
503 | 503 | " plt.barh(range(y_ax_lower, y_ax_upper), c_silhouette_vals, height=1.0, \n", |
504 | 504 | " edgecolor='none', color=color)\n", |
505 | 505 | "\n", |
|
1316 | 1316 | ], |
1317 | 1317 | "metadata": { |
1318 | 1318 | "kernelspec": { |
1319 | | - "display_name": "Python 2", |
| 1319 | + "display_name": "Python 3", |
1320 | 1320 | "language": "python", |
1321 | | - "name": "python2" |
| 1321 | + "name": "python3" |
1322 | 1322 | }, |
1323 | 1323 | "language_info": { |
1324 | 1324 | "codemirror_mode": { |
1325 | 1325 | "name": "ipython", |
1326 | | - "version": 2 |
| 1326 | + "version": 3 |
1327 | 1327 | }, |
1328 | 1328 | "file_extension": ".py", |
1329 | 1329 | "mimetype": "text/x-python", |
1330 | 1330 | "name": "python", |
1331 | 1331 | "nbconvert_exporter": "python", |
1332 | | - "pygments_lexer": "ipython2", |
1333 | | - "version": "2.7.11" |
| 1332 | + "pygments_lexer": "ipython3", |
| 1333 | + "version": "3.5.1" |
1334 | 1334 | } |
1335 | 1335 | }, |
1336 | 1336 | "nbformat": 4, |
|
0 commit comments