add survival and winrates to skillrank aggregation
This commit is contained in:
@@ -225,7 +225,10 @@
|
|||||||
" reducers.sum(\"@nbkills\").alias(\"total_kills\"),\n",
|
" reducers.sum(\"@nbkills\").alias(\"total_kills\"),\n",
|
||||||
" reducers.sum(\"@isdead\").alias(\"total_deaths\")\n",
|
" reducers.sum(\"@isdead\").alias(\"total_deaths\")\n",
|
||||||
" ).sort_by(Desc(\"@total_rounds\")) # pyright: ignore[reportArgumentType]\n",
|
" ).sort_by(Desc(\"@total_rounds\")) # pyright: ignore[reportArgumentType]\n",
|
||||||
" .limit(0, 35565).cursor(10, 1)\n",
|
" .apply(\n",
|
||||||
|
" survival_rate=\"1-(@total_deaths/@total_rounds)\",\n",
|
||||||
|
" win_rate=\"@won_rounds/@total_rounds\"\n",
|
||||||
|
" ).limit(0, 35565).cursor(10, 1)\n",
|
||||||
")\n",
|
")\n",
|
||||||
"\n",
|
"\n",
|
||||||
"response = client.ft().aggregate(query)\n",
|
"response = client.ft().aggregate(query)\n",
|
||||||
@@ -603,6 +606,18 @@
|
|||||||
"display_name": "Python 3 (ipykernel)",
|
"display_name": "Python 3 (ipykernel)",
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"name": "python3"
|
"name": "python3"
|
||||||
|
},
|
||||||
|
"language_info": {
|
||||||
|
"codemirror_mode": {
|
||||||
|
"name": "ipython",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"file_extension": ".py",
|
||||||
|
"mimetype": "text/x-python",
|
||||||
|
"name": "python",
|
||||||
|
"nbconvert_exporter": "python",
|
||||||
|
"pygments_lexer": "ipython3",
|
||||||
|
"version": "3.13.12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
|||||||
Reference in New Issue
Block a user