Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "cells": [
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "# Build the distance matrix\nM = np.empty((len(player_distributions), \n len(player_distributions)))\nfor i, pl1 in enumerate(player_distributions):\n for j, pl2 in enumerate(player_distributions):\n M[i, j] = wasserstein(player_distributions[pl1], \n player_distributions[pl2])\n# Upper diagonal\nupper_M = M[np.triu_indices(len(player_distributions), k = 1)]",
- "execution_count": null,
- "outputs": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "name": "python3",
- "display_name": "Python 3",
- "language": "python"
- },
- "language_info": {
- "name": "python",
- "version": "3.6.3",
- "mimetype": "text/x-python",
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "pygments_lexer": "ipython3",
- "nbconvert_exporter": "python",
- "file_extension": ".py"
- },
- "toc": {
- "nav_menu": {},
- "number_sections": true,
- "sideBar": true,
- "skip_h1_title": false,
- "toc_cell": false,
- "toc_position": {
- "height": "483.41033935546875px",
- "left": "0px",
- "right": "1362px",
- "top": "109.57880401611328px",
- "width": "119.0081558227539px"
- },
- "toc_section_display": "block",
- "toc_window_display": true
- },
- "varInspector": {
- "cols": {
- "lenName": 16,
- "lenType": 16,
- "lenVar": 40
- },
- "kernels_config": {
- "python": {
- "delete_cmd_postfix": "",
- "delete_cmd_prefix": "del ",
- "library": "var_list.py",
- "varRefreshCmd": "print(var_dic_list())"
- },
- "r": {
- "delete_cmd_postfix": ") ",
- "delete_cmd_prefix": "rm(",
- "library": "var_list.r",
- "varRefreshCmd": "cat(var_dic_list()) "
- }
- },
- "types_to_exclude": [
- "module",
- "function",
- "builtin_function_or_method",
- "instance",
- "_Feature"
- ],
- "window_display": false
- },
- "gist_id": "c2d9b00b44ca7ecbb320bc7fb138ee08"
- },
- "nbformat": 4,
- "nbformat_minor": 4
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement