{ "cells": [ { "cell_type": "markdown", "id": "d45381f4", "metadata": {}, "source": [ "# Oddslib basics\n", "TODO" ] }, { "cell_type": "code", "execution_count": 1, "id": "e255d6b8", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "from oddslib.formats import convert_odds, OddsFormat" ] }, { "cell_type": "code", "execution_count": 2, "id": "ff7184a6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([1.90909091])" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "american = -110\n", "decimal = convert_odds(\n", " american,\n", " from_format=OddsFormat.AMERICAN,\n", " to_format=OddsFormat.DECIMAL\n", ")\n", "decimal" ] }, { "cell_type": "code", "execution_count": 3, "id": "a4c234ab", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[2.2 1.68965517]\n" ] } ], "source": [ "american = np.array([+120, -145])\n", "decimal = convert_odds(\n", " american,\n", " from_format=OddsFormat.AMERICAN,\n", " to_format=OddsFormat.DECIMAL,\n", ")\n", "print(decimal)" ] } ], "metadata": { "kernelspec": { "display_name": "oddslib (3.12.11)", "language": "python", "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.12.11" } }, "nbformat": 4, "nbformat_minor": 5 }