{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/var/folders/l_/g22b1g_n0gn4tmx9lkxqv5x00000gn/T/ipykernel_14130/269978020.py:6: DtypeWarning: Columns (7,10) have mixed types. Specify dtype option on import or set low_memory=False.\n", " tools = pd.read_csv(\"../data/tools.csv\")\n" ] } ], "source": [ "import pickle\n", "import pandas as pd\n", "from pathlib import Path\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Make t_map" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "tools = pd.read_csv(\"../data/tools.csv\")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['request_id', 'request_block', 'prompt_request', 'tool', 'nonce',\n", " 'trader_address', 'deliver_block', 'error', 'error_message',\n", " 'prompt_response', 'mech_address', 'p_yes', 'p_no', 'confidence',\n", " 'info_utility', 'vote', 'win_probability', 'title', 'currentAnswer',\n", " 'request_time', 'request_month_year', 'request_month_year_week'],\n", " dtype='object')" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tools.columns" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "import pickle\n", "t_map = tools[['request_block', 'request_time']].set_index('request_block').to_dict()['request_time']\n", "\n", "with open('../data/t_map.pkl', 'wb') as f:\n", " pickle.dump(t_map, f)\n", "\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "with open('../data/t_map.pkl', 'rb') as f:\n", " t_map = pickle.load(f)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Markets" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['id', 'currentAnswer', 'title'], dtype='object')" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fpmms = pd.read_csv(\"../data/fpmms.csv\")\n", "fpmms.columns\n" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idcurrentAnswertitle
00x0020d13c89140b47e10db54cbd53852b90bc1391NoWill the Francis Scott Key Bridge in Baltimore...
10x003ae5e007cc38b3f86b0ed7c82f938a1285ac07NoWill FC Saarbrucken reach the final of the Ger...
20x004c8d4c619dc6b9caa940f5ea7ef699ae85359cYesWill the pro-life activists convicted for 'con...
30x0094fa304017d5c2b355790e2976f769ea600492NoWill the Hisense U8K be considered a top-tier ...
40x00b03e86def06f5afb3b5219df72df758c96ec87YesWill the ChatGPT app for Android exceed 1 mill...
............
30200xff866fd6092f8cc779fed6480e8a0a00740c4685YesWill Nvidia's market value exceed $2 trillion ...
30210xff8fedb76e6659f9da2505b28e86ea3a7db282e7YesWill UFC face a boycott due to its $100M Bud L...
30220xff94627786768f5d94f7e5687de131b34c4b0c0dYesWill there be another volcanic eruption in Gri...
30230xffd0b522ff00ffaec575cc628d1bb4ea37346fd7NoWill the manslaughter trial for James Crumbley...
30240xffd6f34459ff26040e9cf1d9e4d9aaa7026a9683NoWill YouTube's subscribe button light up whene...
\n", "

3025 rows × 3 columns

\n", "
" ], "text/plain": [ " id currentAnswer \\\n", "0 0x0020d13c89140b47e10db54cbd53852b90bc1391 No \n", "1 0x003ae5e007cc38b3f86b0ed7c82f938a1285ac07 No \n", "2 0x004c8d4c619dc6b9caa940f5ea7ef699ae85359c Yes \n", "3 0x0094fa304017d5c2b355790e2976f769ea600492 No \n", "4 0x00b03e86def06f5afb3b5219df72df758c96ec87 Yes \n", "... ... ... \n", "3020 0xff866fd6092f8cc779fed6480e8a0a00740c4685 Yes \n", "3021 0xff8fedb76e6659f9da2505b28e86ea3a7db282e7 Yes \n", "3022 0xff94627786768f5d94f7e5687de131b34c4b0c0d Yes \n", "3023 0xffd0b522ff00ffaec575cc628d1bb4ea37346fd7 No \n", "3024 0xffd6f34459ff26040e9cf1d9e4d9aaa7026a9683 No \n", "\n", " title \n", "0 Will the Francis Scott Key Bridge in Baltimore... \n", "1 Will FC Saarbrucken reach the final of the Ger... \n", "2 Will the pro-life activists convicted for 'con... \n", "3 Will the Hisense U8K be considered a top-tier ... \n", "4 Will the ChatGPT app for Android exceed 1 mill... \n", "... ... \n", "3020 Will Nvidia's market value exceed $2 trillion ... \n", "3021 Will UFC face a boycott due to its $100M Bud L... \n", "3022 Will there be another volcanic eruption in Gri... \n", "3023 Will the manslaughter trial for James Crumbley... \n", "3024 Will YouTube's subscribe button light up whene... \n", "\n", "[3025 rows x 3 columns]" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fpmms" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/var/folders/l_/g22b1g_n0gn4tmx9lkxqv5x00000gn/T/ipykernel_14130/371090584.py:1: DtypeWarning: Columns (2) have mixed types. Specify dtype option on import or set low_memory=False.\n", " delivers = pd.read_csv(\"../data/delivers.csv\")\n" ] }, { "data": { "text/plain": [ "(262750, 12)" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "delivers = pd.read_csv(\"../data/delivers.csv\")\n", "delivers.shape\n" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(244242, 6)" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "requests = pd.read_csv(\"../data/requests.csv\")\n", "requests.columns\n", "\n", "requests.shape" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(243228, 22)" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tools.shape\n", "\n" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/var/folders/l_/g22b1g_n0gn4tmx9lkxqv5x00000gn/T/ipykernel_14130/4197935432.py:1: DtypeWarning: Columns (7,10) have mixed types. Specify dtype option on import or set low_memory=False.\n", " tools = pd.read_csv(\"../data/tools.csv\")\n" ] }, { "data": { "text/plain": [ "Index(['request_id', 'request_block', 'prompt_request', 'tool', 'nonce',\n", " 'trader_address', 'deliver_block', 'error', 'error_message',\n", " 'prompt_response', 'mech_address', 'p_yes', 'p_no', 'confidence',\n", " 'info_utility', 'vote', 'win_probability', 'title', 'currentAnswer',\n", " 'request_time', 'request_month_year', 'request_month_year_week'],\n", " dtype='object')" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tools = pd.read_csv(\"../data/tools.csv\")\n", "tools.columns\n", "\n" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(244623, 22)" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tools.shape" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "autogen", "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.10.13" } }, "nbformat": 4, "nbformat_minor": 2 }