Repository where I mostly put random python scripts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1454 lines
201 KiB

  1. {
  2. "cells": [
  3. {
  4. "cell_type": "markdown",
  5. "metadata": {},
  6. "source": [
  7. "Last week I scrapped a bunch of data from the Steam API using my [Steam Graph Project](https://github.com/jrtechs/SteamFriendsGraph).\n",
  8. "This project captures steam users, their friends, and the games that they own.\n",
  9. "Using the Janus-Graph traversal object, we are able to use the Gremlin graph query language to pull this data.\n",
  10. "Since I am storing the hours played in a game as a property on the relationship between a player and a game node, I had to do a join statement to get the hours property with the game information in a single query. "
  11. ]
  12. },
  13. {
  14. "cell_type": "markdown",
  15. "metadata": {},
  16. "source": [
  17. "```java\n",
  18. "Object o = graph.con.getTraversal()\n",
  19. " .V()\n",
  20. " .hasLabel(Game.KEY_DB)\n",
  21. " .match(\n",
  22. " __.as(\"c\").values(Game.KEY_STEAM_GAME_ID).as(\"gameID\"),\n",
  23. " __.as(\"c\").values(Game.KEY_GAME_NAME).as(\"gameName\"),\n",
  24. " __.as(\"c\").inE(Game.KEY_RELATIONSHIP).values(Game.KEY_PLAY_TIME).as(\"time\")\n",
  25. " ).select(\"gameID\", \"time\", \"gameName\").toList();\n",
  26. "WrappedFileWriter.writeToFile(new Gson().toJson(o).toLowerCase(), \"games.json\");\n",
  27. "```"
  28. ]
  29. },
  30. {
  31. "cell_type": "markdown",
  32. "metadata": {},
  33. "source": [
  34. "Using the game indexing property on the players, I noted that I only ended up fully indexing the games of 481 games. "
  35. ]
  36. },
  37. {
  38. "cell_type": "markdown",
  39. "metadata": {},
  40. "source": [
  41. "```java\n",
  42. "graph.con.getTraversal()\n",
  43. " .V()\n",
  44. " .hasLabel(SteamGraph.KEY_PLAYER)\n",
  45. " .has(SteamGraph.KEY_CRAWLED_GAME_STATUS, 1)\n",
  46. " .count().next()\n",
  47. "```"
  48. ]
  49. },
  50. {
  51. "cell_type": "markdown",
  52. "metadata": {},
  53. "source": [
  54. "We now transition to python and Matlptlib to visualize the data exported from our JanusGraph Query as a json object.\n",
  55. "The dependencies for this [notebook](https://github.com/jrtechs/RandomScripts/tree/master/notebooks) can be installed using pip."
  56. ]
  57. },
  58. {
  59. "cell_type": "code",
  60. "execution_count": 2,
  61. "metadata": {},
  62. "outputs": [
  63. {
  64. "name": "stdout",
  65. "output_type": "stream",
  66. "text": [
  67. "Collecting pandas\n",
  68. " Downloading pandas-1.0.5-cp38-cp38-manylinux1_x86_64.whl (10.0 MB)\n",
  69. "\u001b[K |████████████████████████████████| 10.0 MB 4.3 MB/s eta 0:00:01\n",
  70. "\u001b[?25hCollecting pytz>=2017.2\n",
  71. " Downloading pytz-2020.1-py2.py3-none-any.whl (510 kB)\n",
  72. "\u001b[K |████████████████████████████████| 510 kB 2.9 MB/s eta 0:00:01\n",
  73. "\u001b[?25hRequirement already satisfied: numpy>=1.13.3 in /home/jeff/Documents/python/ml/lib/python3.8/site-packages (from pandas) (1.18.5)\n",
  74. "Requirement already satisfied: python-dateutil>=2.6.1 in /home/jeff/Documents/python/ml/lib/python3.8/site-packages (from pandas) (2.8.1)\n",
  75. "Requirement already satisfied: six>=1.5 in /home/jeff/Documents/python/ml/lib/python3.8/site-packages (from python-dateutil>=2.6.1->pandas) (1.15.0)\n",
  76. "Installing collected packages: pytz, pandas\n",
  77. "Successfully installed pandas-1.0.5 pytz-2020.1\n"
  78. ]
  79. }
  80. ],
  81. "source": [
  82. "!pip install pandas\n",
  83. "!pip install matplotlib"
  84. ]
  85. },
  86. {
  87. "cell_type": "markdown",
  88. "metadata": {},
  89. "source": [
  90. "The first step we are doing is importing our JSON data as a pandas dataframe.\n",
  91. "Pandas is a popular open-source data analysis and manipulation tool.\n",
  92. "I enjoy pandas because it has native integration with matplotlib and supports operations like aggregations and groupings. "
  93. ]
  94. },
  95. {
  96. "cell_type": "code",
  97. "execution_count": 154,
  98. "metadata": {},
  99. "outputs": [
  100. {
  101. "data": {
  102. "text/html": [
  103. "<div>\n",
  104. "<style scoped>\n",
  105. " .dataframe tbody tr th:only-of-type {\n",
  106. " vertical-align: middle;\n",
  107. " }\n",
  108. "\n",
  109. " .dataframe tbody tr th {\n",
  110. " vertical-align: top;\n",
  111. " }\n",
  112. "\n",
  113. " .dataframe thead th {\n",
  114. " text-align: right;\n",
  115. " }\n",
  116. "</style>\n",
  117. "<table border=\"1\" class=\"dataframe\">\n",
  118. " <thead>\n",
  119. " <tr style=\"text-align: right;\">\n",
  120. " <th></th>\n",
  121. " <th>gameid</th>\n",
  122. " <th>time</th>\n",
  123. " <th>gamename</th>\n",
  124. " </tr>\n",
  125. " </thead>\n",
  126. " <tbody>\n",
  127. " <tr>\n",
  128. " <th>0</th>\n",
  129. " <td>210770</td>\n",
  130. " <td>243</td>\n",
  131. " <td>sanctum 2</td>\n",
  132. " </tr>\n",
  133. " <tr>\n",
  134. " <th>1</th>\n",
  135. " <td>210770</td>\n",
  136. " <td>31</td>\n",
  137. " <td>sanctum 2</td>\n",
  138. " </tr>\n",
  139. " <tr>\n",
  140. " <th>2</th>\n",
  141. " <td>210770</td>\n",
  142. " <td>276</td>\n",
  143. " <td>sanctum 2</td>\n",
  144. " </tr>\n",
  145. " <tr>\n",
  146. " <th>3</th>\n",
  147. " <td>210770</td>\n",
  148. " <td>147</td>\n",
  149. " <td>sanctum 2</td>\n",
  150. " </tr>\n",
  151. " <tr>\n",
  152. " <th>4</th>\n",
  153. " <td>210770</td>\n",
  154. " <td>52</td>\n",
  155. " <td>sanctum 2</td>\n",
  156. " </tr>\n",
  157. " <tr>\n",
  158. " <th>...</th>\n",
  159. " <td>...</td>\n",
  160. " <td>...</td>\n",
  161. " <td>...</td>\n",
  162. " </tr>\n",
  163. " <tr>\n",
  164. " <th>36212</th>\n",
  165. " <td>9800</td>\n",
  166. " <td>9</td>\n",
  167. " <td>death to spies</td>\n",
  168. " </tr>\n",
  169. " <tr>\n",
  170. " <th>36213</th>\n",
  171. " <td>445220</td>\n",
  172. " <td>0</td>\n",
  173. " <td>avorion</td>\n",
  174. " </tr>\n",
  175. " <tr>\n",
  176. " <th>36214</th>\n",
  177. " <td>445220</td>\n",
  178. " <td>25509</td>\n",
  179. " <td>avorion</td>\n",
  180. " </tr>\n",
  181. " <tr>\n",
  182. " <th>36215</th>\n",
  183. " <td>445220</td>\n",
  184. " <td>763</td>\n",
  185. " <td>avorion</td>\n",
  186. " </tr>\n",
  187. " <tr>\n",
  188. " <th>36216</th>\n",
  189. " <td>445220</td>\n",
  190. " <td>3175</td>\n",
  191. " <td>avorion</td>\n",
  192. " </tr>\n",
  193. " </tbody>\n",
  194. "</table>\n",
  195. "<p>36217 rows × 3 columns</p>\n",
  196. "</div>"
  197. ],
  198. "text/plain": [
  199. " gameid time gamename\n",
  200. "0 210770 243 sanctum 2\n",
  201. "1 210770 31 sanctum 2\n",
  202. "2 210770 276 sanctum 2\n",
  203. "3 210770 147 sanctum 2\n",
  204. "4 210770 52 sanctum 2\n",
  205. "... ... ... ...\n",
  206. "36212 9800 9 death to spies\n",
  207. "36213 445220 0 avorion\n",
  208. "36214 445220 25509 avorion\n",
  209. "36215 445220 763 avorion\n",
  210. "36216 445220 3175 avorion\n",
  211. "\n",
  212. "[36217 rows x 3 columns]"
  213. ]
  214. },
  215. "execution_count": 154,
  216. "metadata": {},
  217. "output_type": "execute_result"
  218. }
  219. ],
  220. "source": [
  221. "import matplotlib.pyplot as plt\n",
  222. "import pandas as pd\n",
  223. "\n",
  224. "games_df = pd.read_json('games.json')\n",
  225. "games_df"
  226. ]
  227. },
  228. {
  229. "cell_type": "markdown",
  230. "metadata": {},
  231. "source": [
  232. "Using the built-in matplotlib wrapper function, we can graph a historgram of the number of hours played in a game."
  233. ]
  234. },
  235. {
  236. "cell_type": "code",
  237. "execution_count": 21,
  238. "metadata": {},
  239. "outputs": [
  240. {
  241. "data": {
  242. "text/plain": [
  243. "Text(0, 0.5, 'Frequency')"
  244. ]
  245. },
  246. "execution_count": 21,
  247. "metadata": {},
  248. "output_type": "execute_result"
  249. },
  250. {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V3adHBEvAUg6BbgFGAJMj4jF6XinAzMlfQu4jyJpmZlZg5SWRCLiDkBVNs3pZp+zgbOrlM+ptl9ELKO4esvMzJrA31g3M7NsTiJmZpbNScTMzLI5iZiZWTYnETMzy+YkYmZm2ZxEzMwsm5OImZllcxIxM7NsTiJmZpbNScTMzLI5iZiZWTYnETMzy+YkYmZm2ZxEzMwsm5OImZllcxIxM7NsTiJmZpbNScTMzLI5iZiZWTYnETMzy+YkYmZm2ZxEzMwsm5OImZllcxIxM7NsTiJmZpbNScTMzLI5iZiZWTYnETMzy1ZaEpE0StI8SQ9IWizpi6l8W0lzJS1JP4enckm6UNJSSQslja041qRUf4mkSRXle0lalPa5UJLKej9mZvbPyuyJrAdOi4hdgXHAyZJ2BaYAt0XEGOC2tA5wMDAmvSYDl0CRdIAzgX2BfYAzOxJPqvPpiv0mlPh+zMysk9KSSEQ8HhG/T8vPAA8C2wMTgRmp2gzgsLQ8EbgiCncCwySNBA4C5kbE6ohYA8wFJqRtr4uIOyMigCsqjmVmZg2g4vO35Eak0cDtwO7AnyNiWCoXsCYihkm6ETgnIu5I224DTgfagM0j4lup/H8BzwPtqf77U/l7gNMj4oNV2p9M0buhpaVlr5kzZ2a9j1Wrn2bl81m7ssf22+TtWIN169YxdOjQ0o6fy3HVx3HVx3HVp7dxjR8/fn5EtHYu37hXUdVA0lDg58CpEbG2ctoiIkJS6VksIqYB0wBaW1ujra0t6zgXXTWL8xblnbLlR+e1WYv29nZy31OZHFd9HFd9HFd9yoqr1KuzJG1CkUCuiohfpOKVaSiK9HNVKl8BjKrYfYdU1l35DlXKzcysQcq
  253. "text/plain": [
  254. "<Figure size 432x288 with 1 Axes>"
  255. ]
  256. },
  257. "metadata": {
  258. "needs_background": "light"
  259. },
  260. "output_type": "display_data"
  261. }
  262. ],
  263. "source": [
  264. "ax = games_df.hist(column='time', bins=20, range=(0, 4000))\n",
  265. "ax=ax[0][0]\n",
  266. "ax.set_title(\"Game Play Distribution\")\n",
  267. "ax.set_xlabel(\"Minutes Played\")\n",
  268. "ax.set_ylabel(\"Frequency\")"
  269. ]
  270. },
  271. {
  272. "cell_type": "markdown",
  273. "metadata": {},
  274. "source": [
  275. "Notice that the vast majority of the games are rarely ever played, however, it is skewek to the right with a lot of outliers.\n",
  276. "We can change the scale to make it easier to view using the range parameter."
  277. ]
  278. },
  279. {
  280. "cell_type": "code",
  281. "execution_count": 28,
  282. "metadata": {},
  283. "outputs": [
  284. {
  285. "data": {
  286. "text/plain": [
  287. "Text(0, 0.5, 'Frequency')"
  288. ]
  289. },
  290. "execution_count": 28,
  291. "metadata": {},
  292. "output_type": "execute_result"
  293. },
  294. {
  295. "data": {
  296. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEWCAYAAACnlKo3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dfbxd073v8c9XFPFQodHdVBBOQ4+HNmUXvVrdraegLXpVkxMVDxUO6anT3NtGj1dpHefqA+qh1abkiFY9lJJc0hKudVQrJMoVoa6IqKSRIIiN0vC7f8yxZdrdDysje+2Vtdf3/Xqt15rzN8ecY4w189q/jDHnmksRgZmZWY716t0AMzNrXE4iZmaWzUnEzMyyOYmYmVk2JxEzM8vmJGJmZtmcRMwySApJH6hT3fMltfXRscZJuq203qf9ktQuaYe+Op6te5xErK4kjZF0r6RXJC1Py6dIUp3bNSL9QW1Pr0WSJvdzncsk3SzpgHK5iNglIipVHmv9nspFxFURcWAfNB9JFUlf7nT8TSNiYV8c39ZNTiJWN5ImARcC3wfeB7QAJwP7ABvUsWllQyJiU2As8C1Jo/uxzg8Ds4AbJR3b15X0lmDMquEkYnUhaXPgO8ApEXF9RLwchQciYlxEvJ7KHSrpAUkrJT0t6azSMTr+t31c2vaCpJMlfVTSQ5JelHRJp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1rWaJZGIGNtFuNs/9BFxDnBOF/GZwMwu4gsp7t4yM7M68TfWzcwsm5OImZllcxIxM7NsTiJmZpbNScTMzLI5iZiZWTYnETMzy+YkYmZm2ZxEzMwsm5OImZllcxIxM7NsTiJmZpb
  297. "text/plain": [
  298. "<Figure size 432x288 with 1 Axes>"
  299. ]
  300. },
  301. "metadata": {
  302. "needs_background": "light"
  303. },
  304. "output_type": "display_data"
  305. }
  306. ],
  307. "source": [
  308. "ax = games_df.hist(column='time', bins=20, range=(0, 100))\n",
  309. "ax=ax[0][0]\n",
  310. "ax.set_title(\"Game Play Distribution\")\n",
  311. "ax.set_xlabel(\"Minutes Played\")\n",
  312. "ax.set_ylabel(\"Frequency\")"
  313. ]
  314. },
  315. {
  316. "cell_type": "markdown",
  317. "metadata": {},
  318. "source": [
  319. "If we remove games that have never been played, the distribution looks more normal."
  320. ]
  321. },
  322. {
  323. "cell_type": "code",
  324. "execution_count": 155,
  325. "metadata": {},
  326. "outputs": [
  327. {
  328. "data": {
  329. "text/plain": [
  330. "Text(0, 0.5, 'Frequency')"
  331. ]
  332. },
  333. "execution_count": 155,
  334. "metadata": {},
  335. "output_type": "execute_result"
  336. },
  337. {
  338. "data": {
  339. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEWCAYAAACJ0YulAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAbpElEQVR4nO3de5hdVZ3m8e8LESEJJmDokg6BwIBXooIl4GDTFUAbRAVHRGhUgmi0VUTBkeDjozgjNsyoiDqtnQY1eCEIXsgAbYtI2kYFIcAQLtpGCJeIASRcwkWMvPPHXrU5VOpyKlUnp3LO+3me82Rf1t77t2pX9q/W2vusLdtEREQAbNbuACIiYuJIUoiIiFqSQkRE1JIUIiKilqQQERG1JIWIiKglKUT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Xrx42DjWrl3L1KlT11u+fNVDY6rfWMyZOa3lxxiq3p0u9e4+3Vr3sdR77ty5y2z3DrZu0piiGt7dwN22ry7zF1LdP1gtaXvb95TuoXvL+lXArIbtdyjLnsH2QmAhQG9vr/v6+oYNYunSpQxWZt6CS0ZTl3G18ui+lh9jqHp3utS7+3Rr3VtV75Z1H9n+A3CXpBeURQcAtwBLgGPKsmOAi8r0EuAd5SmkfYCHGrqZIiJiI2hlSwHgeODbkrYAbgOOpUpE35V0HHAHcEQpeynwOmAF8FgpGxERG1FLk4LtG4DB+q0OGKSsgfe3Mp6IiBhevtEcERG1JIWIiKg1lRQkzWl1IBER0X7NthT+SdKvJL2vfFM5IiI6UFNJwfbfAEdTfY9
  340. "text/plain": [
  341. "<Figure size 432x288 with 1 Axes>"
  342. ]
  343. },
  344. "metadata": {
  345. "needs_background": "light"
  346. },
  347. "output_type": "display_data"
  348. }
  349. ],
  350. "source": [
  351. "ax = games_df.hist(column='time', bins=20, range=(2, 100))\n",
  352. "ax=ax[0][0]\n",
  353. "ax.set_title(\"Game Play Distribution\")\n",
  354. "ax.set_xlabel(\"Minutes Played\")\n",
  355. "ax.set_ylabel(\"Frequency\")"
  356. ]
  357. },
  358. {
  359. "cell_type": "markdown",
  360. "metadata": {},
  361. "source": [
  362. "Although historgrams are useful, viewing the CDF is often more useful since it is easier to extract numerical information from."
  363. ]
  364. },
  365. {
  366. "cell_type": "code",
  367. "execution_count": 90,
  368. "metadata": {},
  369. "outputs": [
  370. {
  371. "data": {
  372. "text/plain": [
  373. "Text(0, 0.5, 'Frequency')"
  374. ]
  375. },
  376. "execution_count": 90,
  377. "metadata": {},
  378. "output_type": "execute_result"
  379. },
  380. {
  381. "data": {
  382. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEWCAYAAABrDZDcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy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krqBI4EluToBvCZNjwMeKDAelj70RGHDPQ/Ew0GbWbtSRBSzYWk6MC0iTkjzxwH7RcSsXJ1tgeuBLYGxwMERsbDKtmYCMwE6Ozu7uru7m4pp9Zq1bLPVuKbWLVJvby8dHR3DHcYrOK7GtGtc0L6xOa7GDKYNmzp16sKImFx1YUQU8gKmAxfm5o8Dzq2ocxLwhTT9NrKzhVH9bberqyuadc6l1zS9bpF6enqGO4SqHFdj2jWuiPaNzXE1ZjBtGLAgarSrRV4sXgnskJvfPpXlfRy4AiAibgY2BSYUGJOZmVUoMhHMB3aVtLOkTcguBs+pqPM34CAASbuTJYKHC4zJzMwqFJYIImI9MAu4Drib7O6gxZLOkHREqvYF4ERJfwQuA45PpzBmZtYihT6zOCLmAnMryk7LTS8BDigyBjMz659/WWxmVnJOBGZmJedEYGZWck4EZmYl50RgZlZyTgRmZiXnRGBmVnJOBGZmJedEYGZWck4EZmYl50RgZlZyTgRmZiXnRGBmVnJOBGZmJedEYGZWck4EZmYl50RgZlZyTgRmZiXnRGBmVnJOBGZmJedEYGZWck4EZmYl50RgZlZyTgRmZiXnRGBmVnJOBGZmJedEYGZWck4EZmYlV1cikLRn0YGYmdnwqPeM4AeS/iDpU5LGFRqRmZm1VF2JICLeARwD7AAslPRzSYc
  383. "text/plain": [
  384. "<Figure size 432x288 with 1 Axes>"
  385. ]
  386. },
  387. "metadata": {
  388. "needs_background": "light"
  389. },
  390. "output_type": "display_data"
  391. }
  392. ],
  393. "source": [
  394. "ax = games_df.hist(column='time',density=True, range=(0, 2000), histtype='step',cumulative=True)\n",
  395. "ax=ax[0][0]\n",
  396. "ax.set_title(\"Game Play Distribution\")\n",
  397. "ax.set_xlabel(\"Minutes Played\")\n",
  398. "ax.set_ylabel(\"Frequency\")"
  399. ]
  400. },
  401. {
  402. "cell_type": "markdown",
  403. "metadata": {},
  404. "source": [
  405. "80% of people who owns a game plays it under 4 hours. In fact, nearly half of all downloaded or purchased steam games go un-played. This is a cool example of famous 80/20 principle -- aka Pareto principle. The Pareto principle states that for most events, roughly 80% of the effects from 20% of the causes.\n",
  406. "\n",
  407. "As mentioned earlier, the time in owned game distribution is heavily skewed to the right."
  408. ]
  409. },
  410. {
  411. "cell_type": "code",
  412. "execution_count": 31,
  413. "metadata": {},
  414. "outputs": [
  415. {
  416. "data": {
  417. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAEWCAYAAABYGk2QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAYWklEQVR4nO3dfZRkdX3n8fe3etpqYIB5fkimp3tcIWmboMKE8GAUEwQ1xuCGZCETlcRs1nHB7GZNwhyygklMgrskEQ1nzCobWGXExPVh8exhWBuydnSRISBIFEWBKDEg6oiMDyPy3T/urZrbTXfTM3TXb7rn/TqnTt/63Xt/D7fvfObWr6puR2YiSeq9VukOSNKhygCWpEIMYEkqxACWpEIMYEkqxACWpEIMYPVcRGREPKtQ23dHxOlzVNeWiNjZeD6n44qIxyLimXNVnw4+BvACFhHnRsQtEbEnIh6ul18fEVG4X8N1GD1WP+6PiIt63OZDEXF9RLy4uV1mjmbmzbOsa8lM22XmezPzzDnoPhFxc0T8xqT6l2bml+aifh2cDOAFKiL+E/A24L8A64C1wOuA04BnFOxa07LMXAqcB7wpIl7SwzafA9wIfDAizp/rRp4qnKVZyUwfC+wBHA3sAX7xKbb7OeB24FHgy8CljXXDQAK/Vq/7JlWA/yRwJ7AbeMek+n4d+Gy97Q3A0DTtdupe0ii7FXhjvZzAs2bRx48CF06q+07glbNpsy5/I/AQ0Kqf3w+cUS+fBOyq234I+LO6/J/quh6rH6cA5wN/D/w58HXgj+qy8UZbCbwB+BLwCNV/jp12LwXeM1V/gbcAPwS+V7f3jimO09HANcDXgAeA32/UfT4wDvzX+ndzH/DS0uepj1n8Wy7dA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qvbVqvV6tbV3P/CCy/s7jNV34877jh27NjxpLqnarfVanXbGRgY4MILL5yw3+DgIIODg1PWMVVdAwMDE35O126zvpn6OZea7axcubJ7XAcGBjjrrLMYHByc9e9pvvo42/6X6sNCMu/HKzNn/TjxxBNzfwDdR15y1ITni+EREXnMMcd0n5966ql52GGHTdjm8MMPf9J+L3rRiyY8HxkZySOOOKL7/IQTTsh169blihUr8sgjj8zDDz88+/r6ctu2bblz585cv359rl69Oq+99tq89tprc9OmTTk2NpZ79+7Ns88+O4E87bTTcmhoKM8444wEst1u59q1a/Oiiy7KZcuWZavVyosvvri7fmBgIFeuXJmveMUrEsjNmzfn6tWrc/Xq1d26x8bGctOmTRPaPfvss7Ovry+3bt2aw8PDuWXLlmy1WnnUUUfl2NhYXnPNNblu3bpcv359XnPNNRPq6OjUdfHFF+emTZtyy5Yt2dfXl1u2bJlQPtV4x8bGZuznXGq2vXXr1uzr68vly5fnVVddlVu2bOn+vnfu3Jk7d+7MdevWTft7mq8+zrb/pfqwkMzl8QJ25RSZagBPEarN551/ZED3J5Dr1q3LtWvXZkRkq9XKVquV7XY7+/v7u9v19fXl2NhY9vX1TahvdHS0WxYR2W63c3h4uFtPROTY2FiOjY1lf39/9vf35+WXX56jo6OZmTk2NpbDw8M5Ojqao6OjOTY21j3m7XY7t27dmu12O8fGxnJ0dDSXL1+e/f393efDw8O5bt26HB0dzYjohufw8HBmZm7dujUjYkJZR6eOTrvtdjsvv/zyCevWrVuX/f39mZnd7Trrmtt1dLZp/uyMd3L55PFm5oz9nEvNtjvjbvarc5ybfZju9zRffZxt/0v1YSGZy+NlAM/xo9VqzSrE9+7dO6t9J5ft3bt3wr579uzJVquVmZl79+7thnWr1cq9e/dOOOa7d+/u1tGst/O8+Z9GZ/tOWWZ
  418. "text/plain": [
  419. "<Figure size 432x288 with 1 Axes>"
  420. ]
  421. },
  422. "metadata": {
  423. "needs_background": "light"
  424. },
  425. "output_type": "display_data"
  426. }
  427. ],
  428. "source": [
  429. "ax = plt.gca()\n",
  430. "ax.set_title('Game Play Distribution')\n",
  431. "ax.boxplot(games_df['time'], vert=False,manage_ticks=False, notch=True)\n",
  432. "plt.xlabel(\"Game Play in Minutes\")\n",
  433. "ax.set_yticks([])\n",
  434. "plt.show()"
  435. ]
  436. },
  437. {
  438. "cell_type": "markdown",
  439. "metadata": {},
  440. "source": [
  441. "Zooming in on the distribution we see that nearly half of all the purchased games go un-opened."
  442. ]
  443. },
  444. {
  445. "cell_type": "code",
  446. "execution_count": 80,
  447. "metadata": {},
  448. "outputs": [
  449. {
  450. "data": {
  451. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWcAAAEWCAYAAAC6xlbpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAASjklEQVR4nO3deZRedX3H8fcnJB7BYFCDKAhECyhSBRUp7ogLWDkux+WIJopLWwVBrSutVax1rVVwr8WFRRHrXu2pehQqrkBEgYioRRBcgoiooOiEfPvHvWMexkwyT8jk/ibzfp3znNznLr/7nZuZz/zmd5/n96SqkCS1ZcHQBUiS/pzhLEkNMpwlqUGGsyQ1yHCWpAYZzpLUIMNZW1ySSrLHQOdeleSgzdTWU5J8fuT5Zv26klyb5E6bqz3NLYbzHJbkSUm+meS6JFf2y0cmycB1LeuD6tr+cWmSl23hc65O8pkkDxvdr6r2qaozZ9jWwg3tV1UfrKqHb4bySXJmkmdNaX9xVV2yOdrX3GM4z1FJXgicAPwrcDtgJ+DZwP2Amw1Y2qgdqmoxcDjwiiSHbsFz7gt8AfhEkiM290k2FtzSTVZVPubYA1gCXAc8biP7PRI4D/gNcDlw3Mi2ZUABT++3/You3O8NnA9cA7x9SnvPAC7q9/0csPs0551se+HIunOAF/XLBewxgxo/Cxw9pe3zgcfO5Jz9+hcBq4EF/fNLgYf2ywcA5/b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jnnHI466qjZqkez5Oyzz+bQQw8dugxJMzRWOO+4444cc8wxVNVs1aNZss8++3DIIYcMXYakGRornBcvXsyRRx45W7VIknpjf4agJGn2Gc6S1CDDWZIaZDhLUoMMZ0lqkOE
  452. "text/plain": [
  453. "<Figure size 432x288 with 1 Axes>"
  454. ]
  455. },
  456. "metadata": {
  457. "needs_background": "light"
  458. },
  459. "output_type": "display_data"
  460. }
  461. ],
  462. "source": [
  463. "ax = plt.gca()\n",
  464. "ax.set_title('Game Play Distribution')\n",
  465. "ax.boxplot(games_df['time']/60, vert=False,manage_ticks=False, notch=True)\n",
  466. "plt.xlabel(\"Game Play in Hours\")\n",
  467. "ax.set_yticks([])\n",
  468. "ax.set_xlim([0, 10])\n",
  469. "plt.show()"
  470. ]
  471. },
  472. {
  473. "cell_type": "markdown",
  474. "metadata": {},
  475. "source": [
  476. "Viewing the aggregate pool of hours in particular game data is insightful, however, comparing different games against each other is more interesting.\n",
  477. "In pandas, after we create a grouping on a column, we can aggregate it into metrics such as max, min, mean, etc.\n",
  478. "I am also sorting the data I get by count since we are more interested in \"popular\" games."
  479. ]
  480. },
  481. {
  482. "cell_type": "code",
  483. "execution_count": 160,
  484. "metadata": {},
  485. "outputs": [
  486. {
  487. "data": {
  488. "text/html": [
  489. "<div>\n",
  490. "<style scoped>\n",
  491. " .dataframe tbody tr th:only-of-type {\n",
  492. " vertical-align: middle;\n",
  493. " }\n",
  494. "\n",
  495. " .dataframe tbody tr th {\n",
  496. " vertical-align: top;\n",
  497. " }\n",
  498. "\n",
  499. " .dataframe thead tr th {\n",
  500. " text-align: left;\n",
  501. " }\n",
  502. "\n",
  503. " .dataframe thead tr:last-of-type th {\n",
  504. " text-align: right;\n",
  505. " }\n",
  506. "</style>\n",
  507. "<table border=\"1\" class=\"dataframe\">\n",
  508. " <thead>\n",
  509. " <tr>\n",
  510. " <th></th>\n",
  511. " <th colspan=\"4\" halign=\"left\">time</th>\n",
  512. " </tr>\n",
  513. " <tr>\n",
  514. " <th></th>\n",
  515. " <th>count</th>\n",
  516. " <th>min</th>\n",
  517. " <th>max</th>\n",
  518. " <th>mean</th>\n",
  519. " </tr>\n",
  520. " <tr>\n",
  521. " <th>gamename</th>\n",
  522. " <th></th>\n",
  523. " <th></th>\n",
  524. " <th></th>\n",
  525. " <th></th>\n",
  526. " </tr>\n",
  527. " </thead>\n",
  528. " <tbody>\n",
  529. " <tr>\n",
  530. " <th>龙魂时刻</th>\n",
  531. " <td>1</td>\n",
  532. " <td>14</td>\n",
  533. " <td>14</td>\n",
  534. " <td>14.000000</td>\n",
  535. " </tr>\n",
  536. " <tr>\n",
  537. " <th>gryphon knight epic</th>\n",
  538. " <td>1</td>\n",
  539. " <td>0</td>\n",
  540. " <td>0</td>\n",
  541. " <td>0.000000</td>\n",
  542. " </tr>\n",
  543. " <tr>\n",
  544. " <th>growing pains</th>\n",
  545. " <td>1</td>\n",
  546. " <td>0</td>\n",
  547. " <td>0</td>\n",
  548. " <td>0.000000</td>\n",
  549. " </tr>\n",
  550. " <tr>\n",
  551. " <th>shoppy mart: steam edition</th>\n",
  552. " <td>1</td>\n",
  553. " <td>0</td>\n",
  554. " <td>0</td>\n",
  555. " <td>0.000000</td>\n",
  556. " </tr>\n",
  557. " <tr>\n",
  558. " <th>ground pounders</th>\n",
  559. " <td>1</td>\n",
  560. " <td>0</td>\n",
  561. " <td>0</td>\n",
  562. " <td>0.000000</td>\n",
  563. " </tr>\n",
  564. " <tr>\n",
  565. " <th>...</th>\n",
  566. " <td>...</td>\n",
  567. " <td>...</td>\n",
  568. " <td>...</td>\n",
  569. " <td>...</td>\n",
  570. " </tr>\n",
  571. " <tr>\n",
  572. " <th>payday 2</th>\n",
  573. " <td>102</td>\n",
  574. " <td>0</td>\n",
  575. " <td>84023</td>\n",
  576. " <td>5115.813725</td>\n",
  577. " </tr>\n",
  578. " <tr>\n",
  579. " <th>team fortress 2</th>\n",
  580. " <td>105</td>\n",
  581. " <td>7</td>\n",
  582. " <td>304090</td>\n",
  583. " <td>25291.180952</td>\n",
  584. " </tr>\n",
  585. " <tr>\n",
  586. " <th>unturned</th>\n",
  587. " <td>107</td>\n",
  588. " <td>0</td>\n",
  589. " <td>16974</td>\n",
  590. " <td>1339.757009</td>\n",
  591. " </tr>\n",
  592. " <tr>\n",
  593. " <th>garry's mod</th>\n",
  594. " <td>121</td>\n",
  595. " <td>0</td>\n",
  596. " <td>311103</td>\n",
  597. " <td>20890.314050</td>\n",
  598. " </tr>\n",
  599. " <tr>\n",
  600. " <th>counter-strike: global offensive</th>\n",
  601. " <td>129</td>\n",
  602. " <td>0</td>\n",
  603. " <td>506638</td>\n",
  604. " <td>46356.209302</td>\n",
  605. " </tr>\n",
  606. " </tbody>\n",
  607. "</table>\n",
  608. "<p>9235 rows × 4 columns</p>\n",
  609. "</div>"
  610. ],
  611. "text/plain": [
  612. " time \n",
  613. " count min max mean\n",
  614. "gamename \n",
  615. "龙魂时刻 1 14 14 14.000000\n",
  616. "gryphon knight epic 1 0 0 0.000000\n",
  617. "growing pains 1 0 0 0.000000\n",
  618. "shoppy mart: steam edition 1 0 0 0.000000\n",
  619. "ground pounders 1 0 0 0.000000\n",
  620. "... ... .. ... ...\n",
  621. "payday 2 102 0 84023 5115.813725\n",
  622. "team fortress 2 105 7 304090 25291.180952\n",
  623. "unturned 107 0 16974 1339.757009\n",
  624. "garry's mod 121 0 311103 20890.314050\n",
  625. "counter-strike: global offensive 129 0 506638 46356.209302\n",
  626. "\n",
  627. "[9235 rows x 4 columns]"
  628. ]
  629. },
  630. "execution_count": 160,
  631. "metadata": {},
  632. "output_type": "execute_result"
  633. }
  634. ],
  635. "source": [
  636. "stats_df = (games_df.groupby(\"gamename\")\n",
  637. " .agg({'time': ['count', \"min\", 'max', 'mean']})\n",
  638. " .sort_values(by=('time', 'count')))\n",
  639. "stats_df"
  640. ]
  641. },
  642. {
  643. "cell_type": "markdown",
  644. "metadata": {},
  645. "source": [
  646. "To prevent one off essoteric games that I don't have a lot of data for, throwing off my metrics, I am disregarding any games that I have less than 10 values for. "
  647. ]
  648. },
  649. {
  650. "cell_type": "code",
  651. "execution_count": 67,
  652. "metadata": {},
  653. "outputs": [
  654. {
  655. "data": {
  656. "text/html": [
  657. "<div>\n",
  658. "<style scoped>\n",
  659. " .dataframe tbody tr th:only-of-type {\n",
  660. " vertical-align: middle;\n",
  661. " }\n",
  662. "\n",
  663. " .dataframe tbody tr th {\n",
  664. " vertical-align: top;\n",
  665. " }\n",
  666. "\n",
  667. " .dataframe thead tr th {\n",
  668. " text-align: left;\n",
  669. " }\n",
  670. "\n",
  671. " .dataframe thead tr:last-of-type th {\n",
  672. " text-align: right;\n",
  673. " }\n",
  674. "</style>\n",
  675. "<table border=\"1\" class=\"dataframe\">\n",
  676. " <thead>\n",
  677. " <tr>\n",
  678. " <th></th>\n",
  679. " <th colspan=\"4\" halign=\"left\">time</th>\n",
  680. " </tr>\n",
  681. " <tr>\n",
  682. " <th></th>\n",
  683. " <th>count</th>\n",
  684. " <th>min</th>\n",
  685. " <th>max</th>\n",
  686. " <th>mean</th>\n",
  687. " </tr>\n",
  688. " <tr>\n",
  689. " <th>gamename</th>\n",
  690. " <th></th>\n",
  691. " <th></th>\n",
  692. " <th></th>\n",
  693. " <th></th>\n",
  694. " </tr>\n",
  695. " </thead>\n",
  696. " <tbody>\n",
  697. " <tr>\n",
  698. " <th>serious sam hd: the second encounter</th>\n",
  699. " <td>11</td>\n",
  700. " <td>0</td>\n",
  701. " <td>329</td>\n",
  702. " <td>57.909091</td>\n",
  703. " </tr>\n",
  704. " <tr>\n",
  705. " <th>grim fandango remastered</th>\n",
  706. " <td>11</td>\n",
  707. " <td>0</td>\n",
  708. " <td>248</td>\n",
  709. " <td>35.000000</td>\n",
  710. " </tr>\n",
  711. " <tr>\n",
  712. " <th>evga precision x1</th>\n",
  713. " <td>11</td>\n",
  714. " <td>0</td>\n",
  715. " <td>21766</td>\n",
  716. " <td>2498.181818</td>\n",
  717. " </tr>\n",
  718. " <tr>\n",
  719. " <th>f.e.a.r. 2: project origin</th>\n",
  720. " <td>11</td>\n",
  721. " <td>0</td>\n",
  722. " <td>292</td>\n",
  723. " <td>43.272727</td>\n",
  724. " </tr>\n",
  725. " <tr>\n",
  726. " <th>transistor</th>\n",
  727. " <td>11</td>\n",
  728. " <td>0</td>\n",
  729. " <td>972</td>\n",
  730. " <td>298.727273</td>\n",
  731. " </tr>\n",
  732. " <tr>\n",
  733. " <th>...</th>\n",
  734. " <td>...</td>\n",
  735. " <td>...</td>\n",
  736. " <td>...</td>\n",
  737. " <td>...</td>\n",
  738. " </tr>\n",
  739. " <tr>\n",
  740. " <th>payday 2</th>\n",
  741. " <td>102</td>\n",
  742. " <td>0</td>\n",
  743. " <td>84023</td>\n",
  744. " <td>5115.813725</td>\n",
  745. " </tr>\n",
  746. " <tr>\n",
  747. " <th>team fortress 2</th>\n",
  748. " <td>105</td>\n",
  749. " <td>7</td>\n",
  750. " <td>304090</td>\n",
  751. " <td>25291.180952</td>\n",
  752. " </tr>\n",
  753. " <tr>\n",
  754. " <th>unturned</th>\n",
  755. " <td>107</td>\n",
  756. " <td>0</td>\n",
  757. " <td>16974</td>\n",
  758. " <td>1339.757009</td>\n",
  759. " </tr>\n",
  760. " <tr>\n",
  761. " <th>garry's mod</th>\n",
  762. " <td>121</td>\n",
  763. " <td>0</td>\n",
  764. " <td>311103</td>\n",
  765. " <td>20890.314050</td>\n",
  766. " </tr>\n",
  767. " <tr>\n",
  768. " <th>counter-strike: global offensive</th>\n",
  769. " <td>129</td>\n",
  770. " <td>0</td>\n",
  771. " <td>506638</td>\n",
  772. " <td>46356.209302</td>\n",
  773. " </tr>\n",
  774. " </tbody>\n",
  775. "</table>\n",
  776. "<p>701 rows × 4 columns</p>\n",
  777. "</div>"
  778. ],
  779. "text/plain": [
  780. " time \n",
  781. " count min max mean\n",
  782. "gamename \n",
  783. "serious sam hd: the second encounter 11 0 329 57.909091\n",
  784. "grim fandango remastered 11 0 248 35.000000\n",
  785. "evga precision x1 11 0 21766 2498.181818\n",
  786. "f.e.a.r. 2: project origin 11 0 292 43.272727\n",
  787. "transistor 11 0 972 298.727273\n",
  788. "... ... .. ... ...\n",
  789. "payday 2 102 0 84023 5115.813725\n",
  790. "team fortress 2 105 7 304090 25291.180952\n",
  791. "unturned 107 0 16974 1339.757009\n",
  792. "garry's mod 121 0 311103 20890.314050\n",
  793. "counter-strike: global offensive 129 0 506638 46356.209302\n",
  794. "\n",
  795. "[701 rows x 4 columns]"
  796. ]
  797. },
  798. "execution_count": 67,
  799. "metadata": {},
  800. "output_type": "execute_result"
  801. }
  802. ],
  803. "source": [
  804. "stats_df = stats_df[stats_df[('time', 'count')] > 10]\n",
  805. "stats_df"
  806. ]
  807. },
  808. {
  809. "cell_type": "markdown",
  810. "metadata": {},
  811. "source": [
  812. "We see that games on average have a play time of 5-hours in a box-plot."
  813. ]
  814. },
  815. {
  816. "cell_type": "code",
  817. "execution_count": 77,
  818. "metadata": {},
  819. "outputs": [
  820. {
  821. "data": {
  822. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWYAAAEWCAYAAABVBD3XAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAbKklEQVR4nO3dfZRV9X3v8fd3GJAHR2ACowkPMjIzFcSERI1J67VOH6jaLE1WTZeapMmVprHeEl1e60PoTUh7qUlbY1KyzFgjN6aJ06S2abJso3gTWGq0GFBAuejM4BBAUgYdweHxBOZ7/9i/A8dhHs4ZznB+e/N5rXUW++y9z97f2cx85ne+Z+895u6IiEg8qipdgIiIvJ2CWUQkMgpmEZHIKJhFRCKjYBYRiYyCWUQkMgpmOenMzM2soUL73mhml5VpWx8zsxUFz8v6dZnZXjM7p1zbk/RQMKeYmV1rZqvNbJ+ZdYXpm8zMKlzXrBBSe8Nji5ndeZL3udPMHjWz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OISGQUzCIikVEwi4hERsEsIhIZBbOISGQUzCIikVEwi4hERsEsIhIZBbOISGQUzCIikVEwi4hERsEsIhIZBbOISGQUzCIikVEwi4hERsEsIhIZBbOISGQUzCIikVEwi4hERsEsIhIZBbOISGQUzCIikVEwi4hERsEsIhIZBbOISGQUzCIikVEwi4hERsEsIhIZBbOISGQUzCIiBVpbW5k3bx4A8+bNo7W1lUWLFjF27FjMjKqqKszs6LLBtjNjxgzMDOCCUmpQMIuIBK2trSxevJhly5YBsGz
  823. "text/plain": [
  824. "<Figure size 432x288 with 1 Axes>"
  825. ]
  826. },
  827. "metadata": {
  828. "needs_background": "light"
  829. },
  830. "output_type": "display_data"
  831. }
  832. ],
  833. "source": [
  834. "ax = plt.gca()\n",
  835. "ax.set_title('Game Play Distribution')\n",
  836. "ax.boxplot(stats_df[('time', 'mean')]/60, vert=False,manage_ticks=False, notch=True)\n",
  837. "plt.xlabel(\"Mean Game Play in Hours\")\n",
  838. "ax.set_xlim([0, 40])\n",
  839. "ax.set_yticks([])\n",
  840. "plt.show()"
  841. ]
  842. },
  843. {
  844. "cell_type": "markdown",
  845. "metadata": {},
  846. "source": [
  847. "I had a hunch that more popular games got played more, however, I feel like this data-set is still too small the verify this hunch."
  848. ]
  849. },
  850. {
  851. "cell_type": "code",
  852. "execution_count": 71,
  853. "metadata": {},
  854. "outputs": [
  855. {
  856. "data": {
  857. "text/plain": [
  858. "<matplotlib.axes._subplots.AxesSubplot at 0x7fd600786550>"
  859. ]
  860. },
  861. "execution_count": 71,
  862. "metadata": {},
  863. "output_type": "execute_result"
  864. },
  865. {
  866. "data": {
  867. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEGCAYAAACkQqisAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4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NdUZERCSydVd71SwUGfd6IpOAfwMOc/fTzGwWcKK731bU3ImIDDPVdhnfuN1ZdwCPAIeFxy8DXy5GhkREhqvsy/jubO9ib2eaS+5fw9Zd7fmfXCZxg8gEd78XomtLunsXkOrvCWY21cweN7MNZrbezL4U0g82s+Vm9kr4f1xINzO70cxazGyNmR2b9Vrnhf1fMbPzstI/YmZrw3NuNDMbYPlFRCpG5jK+2TKX8a1UcYPIbjMbDziAmZ0A7MjznC7gq+4+CzgBuCh0g10GPObuM4HHwmOA04CZ4XYh8IPwXgcDVwHHA8cBV2UCT9jnb7KeNz9meUREKk41XsY3bhD5CrAU+ICZPQXcCXyxvye4+2Z3fz7c3wm8AEwGzgIWh90WA58O988C7vTI08BYMzsU+BSw3N3fdfdtwHJgfth2oLs/HVYXvjPrtUREqk41XsY37tpZz5vZHwJHEU3vfcndO+O+iZlNBz4MPANMcvfNYdPvgEnh/mSiJeczWkNaf+mtOdJFRKpWtV3GN+7srCRwOjA9POdUM4u1FLyZjQbuB77s7u9lD1u4u5tZ0a9RYmYXEnWRMW3
  868. "text/plain": [
  869. "<Figure size 432x288 with 1 Axes>"
  870. ]
  871. },
  872. "metadata": {
  873. "needs_background": "light"
  874. },
  875. "output_type": "display_data"
  876. }
  877. ],
  878. "source": [
  879. "stats_df.plot.scatter(x=('time', 'count'), y=('time', 'mean'))"
  880. ]
  881. },
  882. {
  883. "cell_type": "code",
  884. "execution_count": null,
  885. "metadata": {},
  886. "outputs": [],
  887. "source": [
  888. "We can create a new filtered dataframe that only contains the result of a single game. "
  889. ]
  890. },
  891. {
  892. "cell_type": "code",
  893. "execution_count": 95,
  894. "metadata": {},
  895. "outputs": [
  896. {
  897. "data": {
  898. "text/html": [
  899. "<div>\n",
  900. "<style scoped>\n",
  901. " .dataframe tbody tr th:only-of-type {\n",
  902. " vertical-align: middle;\n",
  903. " }\n",
  904. "\n",
  905. " .dataframe tbody tr th {\n",
  906. " vertical-align: top;\n",
  907. " }\n",
  908. "\n",
  909. " .dataframe thead th {\n",
  910. " text-align: right;\n",
  911. " }\n",
  912. "</style>\n",
  913. "<table border=\"1\" class=\"dataframe\">\n",
  914. " <thead>\n",
  915. " <tr style=\"text-align: right;\">\n",
  916. " <th></th>\n",
  917. " <th>gameid</th>\n",
  918. " <th>time</th>\n",
  919. " <th>gamename</th>\n",
  920. " </tr>\n",
  921. " </thead>\n",
  922. " <tbody>\n",
  923. " <tr>\n",
  924. " <th>13196</th>\n",
  925. " <td>730</td>\n",
  926. " <td>742</td>\n",
  927. " <td>counter-strike: global offensive</td>\n",
  928. " </tr>\n",
  929. " <tr>\n",
  930. " <th>13197</th>\n",
  931. " <td>730</td>\n",
  932. " <td>16019</td>\n",
  933. " <td>counter-strike: global offensive</td>\n",
  934. " </tr>\n",
  935. " <tr>\n",
  936. " <th>13198</th>\n",
  937. " <td>730</td>\n",
  938. " <td>1781</td>\n",
  939. " <td>counter-strike: global offensive</td>\n",
  940. " </tr>\n",
  941. " <tr>\n",
  942. " <th>13199</th>\n",
  943. " <td>730</td>\n",
  944. " <td>0</td>\n",
  945. " <td>counter-strike: global offensive</td>\n",
  946. " </tr>\n",
  947. " <tr>\n",
  948. " <th>13200</th>\n",
  949. " <td>730</td>\n",
  950. " <td>0</td>\n",
  951. " <td>counter-strike: global offensive</td>\n",
  952. " </tr>\n",
  953. " <tr>\n",
  954. " <th>...</th>\n",
  955. " <td>...</td>\n",
  956. " <td>...</td>\n",
  957. " <td>...</td>\n",
  958. " </tr>\n",
  959. " <tr>\n",
  960. " <th>13320</th>\n",
  961. " <td>730</td>\n",
  962. " <td>3867</td>\n",
  963. " <td>counter-strike: global offensive</td>\n",
  964. " </tr>\n",
  965. " <tr>\n",
  966. " <th>13321</th>\n",
  967. " <td>730</td>\n",
  968. " <td>174176</td>\n",
  969. " <td>counter-strike: global offensive</td>\n",
  970. " </tr>\n",
  971. " <tr>\n",
  972. " <th>13322</th>\n",
  973. " <td>730</td>\n",
  974. " <td>186988</td>\n",
  975. " <td>counter-strike: global offensive</td>\n",
  976. " </tr>\n",
  977. " <tr>\n",
  978. " <th>13323</th>\n",
  979. " <td>730</td>\n",
  980. " <td>103341</td>\n",
  981. " <td>counter-strike: global offensive</td>\n",
  982. " </tr>\n",
  983. " <tr>\n",
  984. " <th>13324</th>\n",
  985. " <td>730</td>\n",
  986. " <td>10483</td>\n",
  987. " <td>counter-strike: global offensive</td>\n",
  988. " </tr>\n",
  989. " </tbody>\n",
  990. "</table>\n",
  991. "<p>129 rows × 3 columns</p>\n",
  992. "</div>"
  993. ],
  994. "text/plain": [
  995. " gameid time gamename\n",
  996. "13196 730 742 counter-strike: global offensive\n",
  997. "13197 730 16019 counter-strike: global offensive\n",
  998. "13198 730 1781 counter-strike: global offensive\n",
  999. "13199 730 0 counter-strike: global offensive\n",
  1000. "13200 730 0 counter-strike: global offensive\n",
  1001. "... ... ... ...\n",
  1002. "13320 730 3867 counter-strike: global offensive\n",
  1003. "13321 730 174176 counter-strike: global offensive\n",
  1004. "13322 730 186988 counter-strike: global offensive\n",
  1005. "13323 730 103341 counter-strike: global offensive\n",
  1006. "13324 730 10483 counter-strike: global offensive\n",
  1007. "\n",
  1008. "[129 rows x 3 columns]"
  1009. ]
  1010. },
  1011. "execution_count": 95,
  1012. "metadata": {},
  1013. "output_type": "execute_result"
  1014. }
  1015. ],
  1016. "source": [
  1017. "cc_df = games_df[games_df['gamename'] == \"counter-strike: global offensive\"]\n",
  1018. "cc_df"
  1019. ]
  1020. },
  1021. {
  1022. "cell_type": "markdown",
  1023. "metadata": {},
  1024. "source": [
  1025. "It is supprizing how many hours certain people play in Counter-Strike. The highest number in the dataset was 8,444 hours or 352 days! "
  1026. ]
  1027. },
  1028. {
  1029. "cell_type": "code",
  1030. "execution_count": 99,
  1031. "metadata": {},
  1032. "outputs": [
  1033. {
  1034. "data": {
  1035. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAEWCAYAAABYGk2QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgA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cAN+b31S/oe3x73FGEb8g+3kl6N7A0Il5Zui5mNngTtgdcLyTtRuol/0PpupjZ0DiAx7E8FtZOGl5ZXrg6ZjZEHoIwMyvEPWAzs0KGdMOUxsbGaGlpGaWqmJlNTLfccktHROzwBZIhBXBLSwurVq0auVqZmdUBSQ/1Nt9DEGZmhTiAzcwKcQCbmRXiADYzK8QBbGZWiAPYzKwQB7CZWSE1+8+1t956K52d6Zaye+yxBwsXLuxz3fvvv5+HHur1srlhOfzww5kxY8Lcw9nMJoiaBfCRRx7JEUccQVdXF21tbaxZs6bPdU855RS6u7uZOXPn/2P3vffey3nnncfpp5++02WZmY2kmgVwd3c311xzDc8++yx77dX/v7p6/PHHWbFiBfvvP5x/uLC9pUuX0t3dvdPlmJmNtJqPAc+cOZPNmzfz7LN9/dNcaGtro7m5uYa1MjOrvZoHsCSamppob2/vdfnGjRuJCKZPn97rcjOziaLIVRDNzc20tbX1uqzS+03/GNbMbOIaswFsZjbROYDNzAopEsD9jQG3t7fT1LTDfYvNzCYc94DNzApxAJuZFeIANjMrxGPAZmaFuAdsZlZIsR5wW1sbEbHDMgewmdWLIgG82267MWXKFDZs2LDd/IjwEISZ1Y1iN2Sv9IKrrV+/nmnTpjFt2rRCtTIzq51iAdzbOLCHH8ysnjiAzcwKKRrAPS9Fa29vdwCbWd0YU2PAbW1tPgFnZnXDQxBmZoU4gM3
  1036. "text/plain": [
  1037. "<Figure size 432x288 with 1 Axes>"
  1038. ]
  1039. },
  1040. "metadata": {
  1041. "needs_background": "light"
  1042. },
  1043. "output_type": "display_data"
  1044. }
  1045. ],
  1046. "source": [
  1047. "ax = plt.gca()\n",
  1048. "ax.set_title('Game Play Distribution for Counter-Strike')\n",
  1049. "ax.boxplot(cc_df['time']/60, vert=False,manage_ticks=False, notch=True)\n",
  1050. "plt.xlabel(\"Game Play in Hours\")\n",
  1051. "ax.set_yticks([])\n",
  1052. "plt.show()"
  1053. ]
  1054. },
  1055. {
  1056. "cell_type": "markdown",
  1057. "metadata": {},
  1058. "source": [
  1059. "Viewing the distribution for a different game like Unturned, yields a vastly different distribution than Counter-Strike. I believe the key difference is that Counter-Strike is played competitively where Unturned is a more leasurely game. It is likely that competative gamers skew the distribution of Counter-Strike to be very high. "
  1060. ]
  1061. },
  1062. {
  1063. "cell_type": "code",
  1064. "execution_count": 102,
  1065. "metadata": {},
  1066. "outputs": [
  1067. {
  1068. "data": {
  1069. "text/html": [
  1070. "<div>\n",
  1071. "<style scoped>\n",
  1072. " .dataframe tbody tr th:only-of-type {\n",
  1073. " vertical-align: middle;\n",
  1074. " }\n",
  1075. "\n",
  1076. " .dataframe tbody tr th {\n",
  1077. " vertical-align: top;\n",
  1078. " }\n",
  1079. "\n",
  1080. " .dataframe thead th {\n",
  1081. " text-align: right;\n",
  1082. " }\n",
  1083. "</style>\n",
  1084. "<table border=\"1\" class=\"dataframe\">\n",
  1085. " <thead>\n",
  1086. " <tr style=\"text-align: right;\">\n",
  1087. " <th></th>\n",
  1088. " <th>gameid</th>\n",
  1089. " <th>time</th>\n",
  1090. " <th>gamename</th>\n",
  1091. " </tr>\n",
  1092. " </thead>\n",
  1093. " <tbody>\n",
  1094. " <tr>\n",
  1095. " <th>167</th>\n",
  1096. " <td>304930</td>\n",
  1097. " <td>140</td>\n",
  1098. " <td>unturned</td>\n",
  1099. " </tr>\n",
  1100. " <tr>\n",
  1101. " <th>168</th>\n",
  1102. " <td>304930</td>\n",
  1103. " <td>723</td>\n",
  1104. " <td>unturned</td>\n",
  1105. " </tr>\n",
  1106. " <tr>\n",
  1107. " <th>169</th>\n",
  1108. " <td>304930</td>\n",
  1109. " <td>1002</td>\n",
  1110. " <td>unturned</td>\n",
  1111. " </tr>\n",
  1112. " <tr>\n",
  1113. " <th>170</th>\n",
  1114. " <td>304930</td>\n",
  1115. " <td>1002</td>\n",
  1116. " <td>unturned</td>\n",
  1117. " </tr>\n",
  1118. " <tr>\n",
  1119. " <th>171</th>\n",
  1120. " <td>304930</td>\n",
  1121. " <td>0</td>\n",
  1122. " <td>unturned</td>\n",
  1123. " </tr>\n",
  1124. " <tr>\n",
  1125. " <th>...</th>\n",
  1126. " <td>...</td>\n",
  1127. " <td>...</td>\n",
  1128. " <td>...</td>\n",
  1129. " </tr>\n",
  1130. " <tr>\n",
  1131. " <th>269</th>\n",
  1132. " <td>304930</td>\n",
  1133. " <td>97</td>\n",
  1134. " <td>unturned</td>\n",
  1135. " </tr>\n",
  1136. " <tr>\n",
  1137. " <th>270</th>\n",
  1138. " <td>304930</td>\n",
  1139. " <td>768</td>\n",
  1140. " <td>unturned</td>\n",
  1141. " </tr>\n",
  1142. " <tr>\n",
  1143. " <th>271</th>\n",
  1144. " <td>304930</td>\n",
  1145. " <td>1570</td>\n",
  1146. " <td>unturned</td>\n",
  1147. " </tr>\n",
  1148. " <tr>\n",
  1149. " <th>272</th>\n",
  1150. " <td>304930</td>\n",
  1151. " <td>23</td>\n",
  1152. " <td>unturned</td>\n",
  1153. " </tr>\n",
  1154. " <tr>\n",
  1155. " <th>273</th>\n",
  1156. " <td>304930</td>\n",
  1157. " <td>115</td>\n",
  1158. " <td>unturned</td>\n",
  1159. " </tr>\n",
  1160. " </tbody>\n",
  1161. "</table>\n",
  1162. "<p>107 rows × 3 columns</p>\n",
  1163. "</div>"
  1164. ],
  1165. "text/plain": [
  1166. " gameid time gamename\n",
  1167. "167 304930 140 unturned\n",
  1168. "168 304930 723 unturned\n",
  1169. "169 304930 1002 unturned\n",
  1170. "170 304930 1002 unturned\n",
  1171. "171 304930 0 unturned\n",
  1172. ".. ... ... ...\n",
  1173. "269 304930 97 unturned\n",
  1174. "270 304930 768 unturned\n",
  1175. "271 304930 1570 unturned\n",
  1176. "272 304930 23 unturned\n",
  1177. "273 304930 115 unturned\n",
  1178. "\n",
  1179. "[107 rows x 3 columns]"
  1180. ]
  1181. },
  1182. "execution_count": 102,
  1183. "metadata": {},
  1184. "output_type": "execute_result"
  1185. }
  1186. ],
  1187. "source": [
  1188. "u_df = games_df[games_df['gamename'] == \"unturned\"]\n",
  1189. "u_df"
  1190. ]
  1191. },
  1192. {
  1193. "cell_type": "code",
  1194. "execution_count": 103,
  1195. "metadata": {},
  1196. "outputs": [
  1197. {
  1198. "data": {
  1199. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAEWCAYAAABYGk2QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAYPUlEQVR4nO3dfZRddX3v8fd3AgQCmSAEeUrIDAVrCLeApJRLKdJWfKB6kaV10VqFq7XXClp7L62wsDXWtqIXrKBtbbVeSC1ob7k+VJeL5DZwJQhIwBBAxAfkIYBBQEgCJCGZ7/1j7wknw5nJOZPJ/mXmvF9rnTX77L3P72Hvcz7zO78zZ09kJpKk5vWVboAk9SoDWJIKMYAlqRADWJIKMYAlqRADWJIKMYCnmIjIiDiiUN13R8SpE1TWWyNiScv9Ce1XRKyPiMMnqryWcn8xIlZGxLqIeN9Elz8VRMT9EfGq0u3YFRjAo4iIsyLiloh4JiIeq5ffExFRuF0DdRitr2/3R8QFDde5JiK+HhGnte6XmQsy8/oOy9ptrP0y818y89UT0Hwi4vqI+P0R5e+TmfdNRPkj/ClwXWbOzMzLd7SwiLgiIv5yxLqOjmG976kRsXpH26GdwwBuIyL+B3AZ8D+Bg4ADgXcDvwrsUbBprfbNzH2A3wH+PCJe22CdxwBLgS9HxDkTXUknwbILmwfcPZ4H7or93hXbNKVkpreWGzALeAZ403b2+y3gu8Ba4CFgUcu2ASCB/1pv+zlVgP8ysAp4Cvj0iPLeAdxT73stMG+UeofL3q1l3a3A+fVyAkd00MZvAO8dUfYq4MxO6qzXnw+sAfrq+/cDr6qXTwBW1HWvAT5Rr3+wLmt9ffvPwDnAjcDfAE8Af1mvW95SVwLvA+4DHqf65Thc7yLgC+3aC/wVsAXYUNf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eOSLDQ4OMjg4ONFNlKTGNRLAF198MZ/85CcZGhoiovqHDLfffjtveMMbtgnl7XniiSc45JBD+OY3v7mzmipJjWkkgPfee+8XrXvqqac44YQTWLp0acflLFmyhEsuuWQimyZJxTQyB9zf3/+idWvXrm27XpJ6hQEsSYU0EsAzZ8580ToDWFKvcwQsSYUYwJJUiAEsSYUYwJJUSNEAbvfhnCT1ikYDuPU/MDsCltTrGgng6dOnA7Bx48at6wxgSb2u0auhrV27dptlA1hSLzOAJamQIgGcmX4IJ6nnFQngDRs2MG3atK1zw5LUi4oEsNMPktRwAK9bt27rTwNYUq9zBCxJhRjAklSIASxJhRjAklSIASxJhRjAklSIASxJhRQLYL+GLKnXOQKWpEIMYEkqxACWpEIaDeANGzawefNmA1iSaDiAZ86cybp16wxgSaLhAO7v72ft2rUGsCRhAEtSMY0H8JNPPsnGjRuZMWNGk1VL0i6n8QB+5JFH6O/vJyKarFqSdjmNB/Dq1audfpAkDGBJKsYAlqRCGv87YANYkiqOgCWpkMYD+NFHH/VSlJJEgQDOTEfAkkSBAG79KUm9zACWpEIMYEkqxACWpEIMYEkqpPEvYoABLEnQcADvtttuzJgxwwCWJBoOYIADDzyQ/fffv+lqJWmX03gAr1y5koP/4eVNV9sVr1UsqQmNB7DTD5JUaTyAJUkVA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjGAJakQA1iSCjG
  1200. "text/plain": [
  1201. "<Figure size 432x288 with 1 Axes>"
  1202. ]
  1203. },
  1204. "metadata": {
  1205. "needs_background": "light"
  1206. },
  1207. "output_type": "display_data"
  1208. }
  1209. ],
  1210. "source": [
  1211. "ax = plt.gca()\n",
  1212. "ax.set_title('Game Play Distribution for Unturned')\n",
  1213. "ax.boxplot(u_df['time']/60, vert=False,manage_ticks=False, notch=True)\n",
  1214. "plt.xlabel(\"Game Play in Hours\")\n",
  1215. "ax.set_yticks([])\n",
  1216. "plt.show()"
  1217. ]
  1218. },
  1219. {
  1220. "cell_type": "markdown",
  1221. "metadata": {},
  1222. "source": [
  1223. "Next, I made a dataframe just containing the raw data points of games that had a aggregate count of over 80. For the sample size of the crawl that I did, having a count of 80, would make the game \"popular\". Since we only have 485 players indexed, having over 80 entries means that over 17% of people scrapped had the game. Glancing at the results, it is easy to verify that the games returned were very popular. "
  1224. ]
  1225. },
  1226. {
  1227. "cell_type": "code",
  1228. "execution_count": 142,
  1229. "metadata": {},
  1230. "outputs": [
  1231. {
  1232. "name": "stderr",
  1233. "output_type": "stream",
  1234. "text": [
  1235. "<ipython-input-142-49f39d385a2a>:2: SettingWithCopyWarning: \n",
  1236. "A value is trying to be set on a copy of a slice from a DataFrame.\n",
  1237. "Try using .loc[row_indexer,col_indexer] = value instead\n",
  1238. "\n",
  1239. "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
  1240. " df1['time'] = df1['time']/60\n"
  1241. ]
  1242. },
  1243. {
  1244. "data": {
  1245. "text/html": [
  1246. "<div>\n",
  1247. "<style scoped>\n",
  1248. " .dataframe tbody tr th:only-of-type {\n",
  1249. " vertical-align: middle;\n",
  1250. " }\n",
  1251. "\n",
  1252. " .dataframe tbody tr th {\n",
  1253. " vertical-align: top;\n",
  1254. " }\n",
  1255. "\n",
  1256. " .dataframe thead th {\n",
  1257. " text-align: right;\n",
  1258. " }\n",
  1259. "</style>\n",
  1260. "<table border=\"1\" class=\"dataframe\">\n",
  1261. " <thead>\n",
  1262. " <tr style=\"text-align: right;\">\n",
  1263. " <th></th>\n",
  1264. " <th>gameid</th>\n",
  1265. " <th>time</th>\n",
  1266. " <th>gamename</th>\n",
  1267. " </tr>\n",
  1268. " </thead>\n",
  1269. " <tbody>\n",
  1270. " <tr>\n",
  1271. " <th>167</th>\n",
  1272. " <td>304930</td>\n",
  1273. " <td>2.333333</td>\n",
  1274. " <td>unturned</td>\n",
  1275. " </tr>\n",
  1276. " <tr>\n",
  1277. " <th>168</th>\n",
  1278. " <td>304930</td>\n",
  1279. " <td>12.050000</td>\n",
  1280. " <td>unturned</td>\n",
  1281. " </tr>\n",
  1282. " <tr>\n",
  1283. " <th>169</th>\n",
  1284. " <td>304930</td>\n",
  1285. " <td>16.700000</td>\n",
  1286. " <td>unturned</td>\n",
  1287. " </tr>\n",
  1288. " <tr>\n",
  1289. " <th>170</th>\n",
  1290. " <td>304930</td>\n",
  1291. " <td>16.700000</td>\n",
  1292. " <td>unturned</td>\n",
  1293. " </tr>\n",
  1294. " <tr>\n",
  1295. " <th>171</th>\n",
  1296. " <td>304930</td>\n",
  1297. " <td>0.000000</td>\n",
  1298. " <td>unturned</td>\n",
  1299. " </tr>\n",
  1300. " <tr>\n",
  1301. " <th>...</th>\n",
  1302. " <td>...</td>\n",
  1303. " <td>...</td>\n",
  1304. " <td>...</td>\n",
  1305. " </tr>\n",
  1306. " <tr>\n",
  1307. " <th>22682</th>\n",
  1308. " <td>578080</td>\n",
  1309. " <td>51.883333</td>\n",
  1310. " <td>playerunknown's battlegrounds</td>\n",
  1311. " </tr>\n",
  1312. " <tr>\n",
  1313. " <th>22683</th>\n",
  1314. " <td>578080</td>\n",
  1315. " <td>47.616667</td>\n",
  1316. " <td>playerunknown's battlegrounds</td>\n",
  1317. " </tr>\n",
  1318. " <tr>\n",
  1319. " <th>22684</th>\n",
  1320. " <td>578080</td>\n",
  1321. " <td>30.650000</td>\n",
  1322. " <td>playerunknown's battlegrounds</td>\n",
  1323. " </tr>\n",
  1324. " <tr>\n",
  1325. " <th>22685</th>\n",
  1326. " <td>578080</td>\n",
  1327. " <td>170.083333</td>\n",
  1328. " <td>playerunknown's battlegrounds</td>\n",
  1329. " </tr>\n",
  1330. " <tr>\n",
  1331. " <th>22686</th>\n",
  1332. " <td>578080</td>\n",
  1333. " <td>399.950000</td>\n",
  1334. " <td>playerunknown's battlegrounds</td>\n",
  1335. " </tr>\n",
  1336. " </tbody>\n",
  1337. "</table>\n",
  1338. "<p>1099 rows × 3 columns</p>\n",
  1339. "</div>"
  1340. ],
  1341. "text/plain": [
  1342. " gameid time gamename\n",
  1343. "167 304930 2.333333 unturned\n",
  1344. "168 304930 12.050000 unturned\n",
  1345. "169 304930 16.700000 unturned\n",
  1346. "170 304930 16.700000 unturned\n",
  1347. "171 304930 0.000000 unturned\n",
  1348. "... ... ... ...\n",
  1349. "22682 578080 51.883333 playerunknown's battlegrounds\n",
  1350. "22683 578080 47.616667 playerunknown's battlegrounds\n",
  1351. "22684 578080 30.650000 playerunknown's battlegrounds\n",
  1352. "22685 578080 170.083333 playerunknown's battlegrounds\n",
  1353. "22686 578080 399.950000 playerunknown's battlegrounds\n",
  1354. "\n",
  1355. "[1099 rows x 3 columns]"
  1356. ]
  1357. },
  1358. "execution_count": 142,
  1359. "metadata": {},
  1360. "output_type": "execute_result"
  1361. }
  1362. ],
  1363. "source": [
  1364. "df1 = games_df[games_df['gamename'].map(games_df['gamename'].value_counts()) > 80]\n",
  1365. "df1['time'] = df1['time']/60\n",
  1366. "df1"
  1367. ]
  1368. },
  1369. {
  1370. "cell_type": "code",
  1371. "execution_count": 143,
  1372. "metadata": {},
  1373. "outputs": [
  1374. {
  1375. "data": {
  1376. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAhoAAAEcCAYAAACBCB2mAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOzdeXxU1f3/8dc7kxiWoCxiUAkE9yy1Wuhi1Rpba9WqpVW/LVpb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l5d0uv2bNGvr377/5OrSV8nHKno9VdnycspMP4zR//vx3zGxo+3QPNNwnQnl5OfPmzet2+Xg8Tk1Nzebr0FbKxyl7PlbZ8XHKTj6Mk6Sl6dL91olzzjnncsYDDeecc87ljAcaznXitBufYfw/17B2faKnu+Kcc72OBxrOdeLv818DoKm5pYd74pxzvY8HGm6zkLSPpCN6qO2mnmjXOedc5zzQcJvLPkCXAg1F8v7P4F7DBjCgYjJDB/RBUsatoKCAgoICqqurqaur6+luO+dcXsj7f+Rdz5BULmlhyvFpks6WFJd0nqR/S3pB0oGStgF+D3xb0tOSvh3ynpZSfmGos1zS85JmAwuBAyU1SrpS0iJJ90jqG8rsKumfkuZL+pekvUL6KEmPSlog6Zxcj8UzF/+4dX+bbbZh6NC2XxMfOXIkAJWVlRQUFLD77rtTW1vrwYZzzuGBhuueQjP7HHAq8FszWwecBVxvZvuY2fWdlN8duNTMqoCl4fjP4XgVcEzIdwUwycxGA6cBl4b0i4HLzOxTwJub88LSWb7khdb9f/7zn3zwwQdUVVV9fH75cn72s5/x0ksvcf7553PXXXc
  1377. "text/plain": [
  1378. "<Figure size 432x288 with 1 Axes>"
  1379. ]
  1380. },
  1381. "metadata": {
  1382. "needs_background": "light"
  1383. },
  1384. "output_type": "display_data"
  1385. }
  1386. ],
  1387. "source": [
  1388. "ax = plt.gca()\n",
  1389. "ax.set_title('Steps Distribution for July\\n')\n",
  1390. "df1.boxplot(column=[\"time\"], by='gamename',ax=ax, notch=True, vert=False)\n",
  1391. "plt.xlabel(\"Hours Played\")\n",
  1392. "plt.ylabel(\"Games\")\n",
  1393. "plt.show()"
  1394. ]
  1395. },
  1396. {
  1397. "cell_type": "code",
  1398. "execution_count": 153,
  1399. "metadata": {},
  1400. "outputs": [
  1401. {
  1402. "data": {
  1403. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAicAAAEVCAYAAAA7CkXmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29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Fou1fI1EIq22o9EoDQ0NLW0T68XF66UavyslxtoT9KR4LdbcsFh7BktOTCrbaH3ZryhhvdF9jZH6Z6i99m3/XKYxYT0G9HNtP1bVcSn6T/s6bVWdDcwG6FfeTysrK/nPB4uZedQwTjuolKKb/FxSupqfAhUVFWzatImNGzfy0Ucf4fP5KCwsJBaLMWLECIqKihgwYADLly+nsLCQMWPGpHxyo9/vZ/ny5Vx66aUtZTNnzsTv97PXXnvh8/moqKjA5/NRWVlJXV1dy3ZFRQUDBw5s6TuxXly8fj48ObKnPcGyJ8VrseaGxdoz2D0nJpUPgBEiMlRE/MDX0tT/FBiUsF0PHAQgIgcB5R0ZXFU/Ad4SkW+5PkREDnC7nwG+7dbP7kCfrbbPP/98rrjiCgAuu+wy1q1bx0cffURhYSGnnXYaBQUFNDc38/7777Nhwwb2339/Lr/8coqKiqiqqko5TrzfmTNn8tlnnzFz5kyuuOIKzj//fKqqqpg0aRITJ07k+9//PjNnzmzZnjRp0nb9xuvX1dWxdetW6urqktYzxpidSrauD9my8y3Aj4E3gCeBaj6/52S82z8MqHfrQ4AFwGLgDLzZj3nAMuA2IMrn95wk3svSdvsyYJpbLwfmAkuA5cDVCeXPAUuBa8jgnpO+JXvpOx991uqeE1XVKVOmqN/
  1404. "text/plain": [
  1405. "<Figure size 432x288 with 1 Axes>"
  1406. ]
  1407. },
  1408. "metadata": {
  1409. "needs_background": "light"
  1410. },
  1411. "output_type": "display_data"
  1412. }
  1413. ],
  1414. "source": [
  1415. "ax = df1.boxplot(column=[\"time\"], by='gamename', notch=True, vert=False)\n",
  1416. "fig = ax.get_figure()\n",
  1417. "fig.suptitle('')\n",
  1418. "ax.set_title('Play-time Distribution')\n",
  1419. "plt.xlabel(\"Hours Played\")\n",
  1420. "ax.set_xlim([0, 2000])\n",
  1421. "plt.ylabel(\"Game\")\n",
  1422. "plt.savefig(\"playTimes.png\", dpi=300, bbox_inches = \"tight\")"
  1423. ]
  1424. },
  1425. {
  1426. "cell_type": "markdown",
  1427. "metadata": {},
  1428. "source": [
  1429. "Overall this is really interesting to see how the distributions for different games vary. In the future I am going to re-run some of these analytics with even more data and possibly put them on my website as a interactive graph."
  1430. ]
  1431. }
  1432. ],
  1433. "metadata": {
  1434. "kernelspec": {
  1435. "display_name": "ml",
  1436. "language": "python",
  1437. "name": "ml"
  1438. },
  1439. "language_info": {
  1440. "codemirror_mode": {
  1441. "name": "ipython",
  1442. "version": 3
  1443. },
  1444. "file_extension": ".py",
  1445. "mimetype": "text/x-python",
  1446. "name": "python",
  1447. "nbconvert_exporter": "python",
  1448. "pygments_lexer": "ipython3",
  1449. "version": "3.8.3"
  1450. }
  1451. },
  1452. "nbformat": 4,
  1453. "nbformat_minor": 4
  1454. }