cyberosa
commited on
Commit
·
f62548d
1
Parent(s):
5f0d39e
new weekly data
Browse files- data/closed_markets_div.parquet +2 -2
- notebooks/outliers.ipynb +607 -0
data/closed_markets_div.parquet
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8df376959d26e13d47dcbe3c25acc82f028e35f33ef7928a869eed102d8c7e34
|
3 |
+
size 64570
|
notebooks/outliers.ipynb
ADDED
@@ -0,0 +1,607 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"metadata": {},
|
7 |
+
"outputs": [],
|
8 |
+
"source": [
|
9 |
+
"import pandas as pd\n",
|
10 |
+
"import sys\n",
|
11 |
+
"sys.path.append('..')\n",
|
12 |
+
"from scripts.metrics import compute_weekly_metrics_by_market_creator"
|
13 |
+
]
|
14 |
+
},
|
15 |
+
{
|
16 |
+
"cell_type": "code",
|
17 |
+
"execution_count": 2,
|
18 |
+
"metadata": {},
|
19 |
+
"outputs": [],
|
20 |
+
"source": [
|
21 |
+
"all_trades = pd.read_parquet('../data/all_trades_profitability.parquet')"
|
22 |
+
]
|
23 |
+
},
|
24 |
+
{
|
25 |
+
"cell_type": "code",
|
26 |
+
"execution_count": 3,
|
27 |
+
"metadata": {},
|
28 |
+
"outputs": [
|
29 |
+
{
|
30 |
+
"data": {
|
31 |
+
"text/plain": [
|
32 |
+
"num_mech_calls\n",
|
33 |
+
"1 5231\n",
|
34 |
+
"2 4590\n",
|
35 |
+
"0 4555\n",
|
36 |
+
"4 4457\n",
|
37 |
+
"3 4387\n",
|
38 |
+
" ... \n",
|
39 |
+
"63 1\n",
|
40 |
+
"59 1\n",
|
41 |
+
"37 1\n",
|
42 |
+
"65 1\n",
|
43 |
+
"53 1\n",
|
44 |
+
"Name: count, Length: 67, dtype: int64"
|
45 |
+
]
|
46 |
+
},
|
47 |
+
"execution_count": 3,
|
48 |
+
"metadata": {},
|
49 |
+
"output_type": "execute_result"
|
50 |
+
}
|
51 |
+
],
|
52 |
+
"source": [
|
53 |
+
"all_trades.num_mech_calls.value_counts()"
|
54 |
+
]
|
55 |
+
},
|
56 |
+
{
|
57 |
+
"cell_type": "code",
|
58 |
+
"execution_count": 4,
|
59 |
+
"metadata": {},
|
60 |
+
"outputs": [],
|
61 |
+
"source": [
|
62 |
+
"all_trades[\"creation_date\"] = all_trades[\"creation_timestamp\"].dt.date\n"
|
63 |
+
]
|
64 |
+
},
|
65 |
+
{
|
66 |
+
"cell_type": "code",
|
67 |
+
"execution_count": 5,
|
68 |
+
"metadata": {},
|
69 |
+
"outputs": [
|
70 |
+
{
|
71 |
+
"name": "stderr",
|
72 |
+
"output_type": "stream",
|
73 |
+
"text": [
|
74 |
+
"/var/folders/gp/02mb1d514ng739czlxw1lhh00000gn/T/ipykernel_15029/1825242321.py:6: UserWarning: Converting to PeriodArray/Index representation will drop timezone information.\n",
|
75 |
+
" all_trades[\"creation_timestamp\"].dt.to_period(\"W\").dt.strftime(\"%b-%d\")\n"
|
76 |
+
]
|
77 |
+
}
|
78 |
+
],
|
79 |
+
"source": [
|
80 |
+
"all_trades = all_trades.sort_values(\n",
|
81 |
+
" by=\"creation_timestamp\", ascending=True\n",
|
82 |
+
")\n",
|
83 |
+
"\n",
|
84 |
+
"all_trades[\"month_year_week\"] = (\n",
|
85 |
+
" all_trades[\"creation_timestamp\"].dt.to_period(\"W\").dt.strftime(\"%b-%d\")\n",
|
86 |
+
")"
|
87 |
+
]
|
88 |
+
},
|
89 |
+
{
|
90 |
+
"cell_type": "code",
|
91 |
+
"execution_count": 6,
|
92 |
+
"metadata": {},
|
93 |
+
"outputs": [
|
94 |
+
{
|
95 |
+
"name": "stdout",
|
96 |
+
"output_type": "stream",
|
97 |
+
"text": [
|
98 |
+
"Computing weekly metrics for week =Sep-15 by market creator\n"
|
99 |
+
]
|
100 |
+
},
|
101 |
+
{
|
102 |
+
"name": "stderr",
|
103 |
+
"output_type": "stream",
|
104 |
+
"text": [
|
105 |
+
"Trader' metrics: 100%|██████████| 38/38 [00:00<00:00, 858.56metrics/s]\n"
|
106 |
+
]
|
107 |
+
},
|
108 |
+
{
|
109 |
+
"name": "stdout",
|
110 |
+
"output_type": "stream",
|
111 |
+
"text": [
|
112 |
+
"Computing weekly metrics for week =Sep-22 by market creator\n"
|
113 |
+
]
|
114 |
+
},
|
115 |
+
{
|
116 |
+
"name": "stderr",
|
117 |
+
"output_type": "stream",
|
118 |
+
"text": [
|
119 |
+
"Trader' metrics: 100%|██████████| 95/95 [00:00<00:00, 726.25metrics/s]\n"
|
120 |
+
]
|
121 |
+
},
|
122 |
+
{
|
123 |
+
"name": "stdout",
|
124 |
+
"output_type": "stream",
|
125 |
+
"text": [
|
126 |
+
"Computing weekly metrics for week =Sep-29 by market creator\n"
|
127 |
+
]
|
128 |
+
},
|
129 |
+
{
|
130 |
+
"name": "stderr",
|
131 |
+
"output_type": "stream",
|
132 |
+
"text": [
|
133 |
+
"Trader' metrics: 100%|██████████| 119/119 [00:00<00:00, 724.34metrics/s]\n"
|
134 |
+
]
|
135 |
+
},
|
136 |
+
{
|
137 |
+
"name": "stdout",
|
138 |
+
"output_type": "stream",
|
139 |
+
"text": [
|
140 |
+
"Computing weekly metrics for week =Oct-06 by market creator\n"
|
141 |
+
]
|
142 |
+
},
|
143 |
+
{
|
144 |
+
"name": "stderr",
|
145 |
+
"output_type": "stream",
|
146 |
+
"text": [
|
147 |
+
"Trader' metrics: 100%|██████████| 95/95 [00:00<00:00, 662.54metrics/s]\n"
|
148 |
+
]
|
149 |
+
},
|
150 |
+
{
|
151 |
+
"name": "stdout",
|
152 |
+
"output_type": "stream",
|
153 |
+
"text": [
|
154 |
+
"Computing weekly metrics for week =Oct-13 by market creator\n"
|
155 |
+
]
|
156 |
+
},
|
157 |
+
{
|
158 |
+
"name": "stderr",
|
159 |
+
"output_type": "stream",
|
160 |
+
"text": [
|
161 |
+
"Trader' metrics: 100%|██████████| 117/117 [00:00<00:00, 665.98metrics/s]\n"
|
162 |
+
]
|
163 |
+
},
|
164 |
+
{
|
165 |
+
"name": "stdout",
|
166 |
+
"output_type": "stream",
|
167 |
+
"text": [
|
168 |
+
"Computing weekly metrics for week =Oct-20 by market creator\n"
|
169 |
+
]
|
170 |
+
},
|
171 |
+
{
|
172 |
+
"name": "stderr",
|
173 |
+
"output_type": "stream",
|
174 |
+
"text": [
|
175 |
+
"Trader' metrics: 100%|██████████| 129/129 [00:00<00:00, 819.97metrics/s]\n"
|
176 |
+
]
|
177 |
+
},
|
178 |
+
{
|
179 |
+
"name": "stdout",
|
180 |
+
"output_type": "stream",
|
181 |
+
"text": [
|
182 |
+
"Computing weekly metrics for week =Oct-27 by market creator\n"
|
183 |
+
]
|
184 |
+
},
|
185 |
+
{
|
186 |
+
"name": "stderr",
|
187 |
+
"output_type": "stream",
|
188 |
+
"text": [
|
189 |
+
"Trader' metrics: 100%|██████████| 205/205 [00:00<00:00, 679.75metrics/s]\n"
|
190 |
+
]
|
191 |
+
},
|
192 |
+
{
|
193 |
+
"name": "stdout",
|
194 |
+
"output_type": "stream",
|
195 |
+
"text": [
|
196 |
+
"Computing weekly metrics for week =Nov-03 by market creator\n"
|
197 |
+
]
|
198 |
+
},
|
199 |
+
{
|
200 |
+
"name": "stderr",
|
201 |
+
"output_type": "stream",
|
202 |
+
"text": [
|
203 |
+
"Trader' metrics: 100%|██████████| 361/361 [00:00<00:00, 754.52metrics/s]\n"
|
204 |
+
]
|
205 |
+
},
|
206 |
+
{
|
207 |
+
"name": "stdout",
|
208 |
+
"output_type": "stream",
|
209 |
+
"text": [
|
210 |
+
"Computing weekly metrics for week =Nov-10 by market creator\n"
|
211 |
+
]
|
212 |
+
},
|
213 |
+
{
|
214 |
+
"name": "stderr",
|
215 |
+
"output_type": "stream",
|
216 |
+
"text": [
|
217 |
+
"Trader' metrics: 100%|██████████| 357/357 [00:00<00:00, 723.25metrics/s]\n"
|
218 |
+
]
|
219 |
+
},
|
220 |
+
{
|
221 |
+
"name": "stdout",
|
222 |
+
"output_type": "stream",
|
223 |
+
"text": [
|
224 |
+
"Computing weekly metrics for week =Nov-17 by market creator\n"
|
225 |
+
]
|
226 |
+
},
|
227 |
+
{
|
228 |
+
"name": "stderr",
|
229 |
+
"output_type": "stream",
|
230 |
+
"text": [
|
231 |
+
"Trader' metrics: 100%|██████████| 411/411 [00:00<00:00, 714.79metrics/s]\n"
|
232 |
+
]
|
233 |
+
},
|
234 |
+
{
|
235 |
+
"name": "stdout",
|
236 |
+
"output_type": "stream",
|
237 |
+
"text": [
|
238 |
+
"End computing all weekly metrics by market creator\n"
|
239 |
+
]
|
240 |
+
}
|
241 |
+
],
|
242 |
+
"source": [
|
243 |
+
"weekly_metrics_by_market_creator = compute_weekly_metrics_by_market_creator(\n",
|
244 |
+
" all_trades\n",
|
245 |
+
")"
|
246 |
+
]
|
247 |
+
},
|
248 |
+
{
|
249 |
+
"cell_type": "code",
|
250 |
+
"execution_count": 7,
|
251 |
+
"metadata": {},
|
252 |
+
"outputs": [],
|
253 |
+
"source": [
|
254 |
+
"weekly_metrics_by_market_creator_pearl = weekly_metrics_by_market_creator.loc[weekly_metrics_by_market_creator[\"market_creator\"]==\"pearl\"]"
|
255 |
+
]
|
256 |
+
},
|
257 |
+
{
|
258 |
+
"cell_type": "code",
|
259 |
+
"execution_count": 8,
|
260 |
+
"metadata": {},
|
261 |
+
"outputs": [
|
262 |
+
{
|
263 |
+
"data": {
|
264 |
+
"text/plain": [
|
265 |
+
"nr_mech_calls\n",
|
266 |
+
"0 191\n",
|
267 |
+
"1 152\n",
|
268 |
+
"2 105\n",
|
269 |
+
"3 63\n",
|
270 |
+
"4 41\n",
|
271 |
+
" ... \n",
|
272 |
+
"62 1\n",
|
273 |
+
"13429 1\n",
|
274 |
+
"1099 1\n",
|
275 |
+
"154 1\n",
|
276 |
+
"254 1\n",
|
277 |
+
"Name: count, Length: 88, dtype: int64"
|
278 |
+
]
|
279 |
+
},
|
280 |
+
"execution_count": 8,
|
281 |
+
"metadata": {},
|
282 |
+
"output_type": "execute_result"
|
283 |
+
}
|
284 |
+
],
|
285 |
+
"source": [
|
286 |
+
"weekly_metrics_by_market_creator_pearl.nr_mech_calls.value_counts()"
|
287 |
+
]
|
288 |
+
},
|
289 |
+
{
|
290 |
+
"cell_type": "code",
|
291 |
+
"execution_count": 9,
|
292 |
+
"metadata": {},
|
293 |
+
"outputs": [
|
294 |
+
{
|
295 |
+
"data": {
|
296 |
+
"text/html": [
|
297 |
+
"<div>\n",
|
298 |
+
"<style scoped>\n",
|
299 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
300 |
+
" vertical-align: middle;\n",
|
301 |
+
" }\n",
|
302 |
+
"\n",
|
303 |
+
" .dataframe tbody tr th {\n",
|
304 |
+
" vertical-align: top;\n",
|
305 |
+
" }\n",
|
306 |
+
"\n",
|
307 |
+
" .dataframe thead th {\n",
|
308 |
+
" text-align: right;\n",
|
309 |
+
" }\n",
|
310 |
+
"</style>\n",
|
311 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
312 |
+
" <thead>\n",
|
313 |
+
" <tr style=\"text-align: right;\">\n",
|
314 |
+
" <th></th>\n",
|
315 |
+
" <th>trader_address</th>\n",
|
316 |
+
" <th>net_earnings</th>\n",
|
317 |
+
" <th>earnings</th>\n",
|
318 |
+
" <th>bet_amount</th>\n",
|
319 |
+
" <th>nr_mech_calls</th>\n",
|
320 |
+
" <th>nr_trades</th>\n",
|
321 |
+
" <th>roi</th>\n",
|
322 |
+
" <th>month_year_week</th>\n",
|
323 |
+
" <th>market_creator</th>\n",
|
324 |
+
" </tr>\n",
|
325 |
+
" </thead>\n",
|
326 |
+
" <tbody>\n",
|
327 |
+
" <tr>\n",
|
328 |
+
" <th>1998</th>\n",
|
329 |
+
" <td>0x87f0fcfe810502555f8d1439793155cbfa2eb583</td>\n",
|
330 |
+
" <td>-135.245314</td>\n",
|
331 |
+
" <td>1.014186</td>\n",
|
332 |
+
" <td>1.95</td>\n",
|
333 |
+
" <td>13429</td>\n",
|
334 |
+
" <td>78</td>\n",
|
335 |
+
" <td>-0.499927</td>\n",
|
336 |
+
" <td>Nov-03</td>\n",
|
337 |
+
" <td>pearl</td>\n",
|
338 |
+
" </tr>\n",
|
339 |
+
" </tbody>\n",
|
340 |
+
"</table>\n",
|
341 |
+
"</div>"
|
342 |
+
],
|
343 |
+
"text/plain": [
|
344 |
+
" trader_address net_earnings earnings \\\n",
|
345 |
+
"1998 0x87f0fcfe810502555f8d1439793155cbfa2eb583 -135.245314 1.014186 \n",
|
346 |
+
"\n",
|
347 |
+
" bet_amount nr_mech_calls nr_trades roi month_year_week \\\n",
|
348 |
+
"1998 1.95 13429 78 -0.499927 Nov-03 \n",
|
349 |
+
"\n",
|
350 |
+
" market_creator \n",
|
351 |
+
"1998 pearl "
|
352 |
+
]
|
353 |
+
},
|
354 |
+
"execution_count": 9,
|
355 |
+
"metadata": {},
|
356 |
+
"output_type": "execute_result"
|
357 |
+
}
|
358 |
+
],
|
359 |
+
"source": [
|
360 |
+
"weekly_metrics_by_market_creator_pearl.loc[weekly_metrics_by_market_creator_pearl[\"nr_mech_calls\"]==13429]"
|
361 |
+
]
|
362 |
+
},
|
363 |
+
{
|
364 |
+
"cell_type": "code",
|
365 |
+
"execution_count": 10,
|
366 |
+
"metadata": {},
|
367 |
+
"outputs": [],
|
368 |
+
"source": [
|
369 |
+
"trader = \"0x87f0fcfe810502555f8d1439793155cbfa2eb583\"\n",
|
370 |
+
"selected_week = \"Nov-03\""
|
371 |
+
]
|
372 |
+
},
|
373 |
+
{
|
374 |
+
"cell_type": "code",
|
375 |
+
"execution_count": 11,
|
376 |
+
"metadata": {},
|
377 |
+
"outputs": [],
|
378 |
+
"source": [
|
379 |
+
"trader_data = all_trades.loc[(all_trades[\"trader_address\"]==trader)&(all_trades[\"month_year_week\"]==selected_week)]"
|
380 |
+
]
|
381 |
+
},
|
382 |
+
{
|
383 |
+
"cell_type": "code",
|
384 |
+
"execution_count": 12,
|
385 |
+
"metadata": {},
|
386 |
+
"outputs": [
|
387 |
+
{
|
388 |
+
"name": "stdout",
|
389 |
+
"output_type": "stream",
|
390 |
+
"text": [
|
391 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
392 |
+
"Index: 78 entries, 26553 to 31970\n",
|
393 |
+
"Data columns (total 23 columns):\n",
|
394 |
+
" # Column Non-Null Count Dtype \n",
|
395 |
+
"--- ------ -------------- ----- \n",
|
396 |
+
" 0 trader_address 78 non-null object \n",
|
397 |
+
" 1 market_creator 78 non-null object \n",
|
398 |
+
" 2 trade_id 78 non-null object \n",
|
399 |
+
" 3 creation_timestamp 78 non-null datetime64[ns, UTC]\n",
|
400 |
+
" 4 title 78 non-null object \n",
|
401 |
+
" 5 market_status 78 non-null object \n",
|
402 |
+
" 6 collateral_amount 78 non-null float64 \n",
|
403 |
+
" 7 outcome_index 78 non-null object \n",
|
404 |
+
" 8 trade_fee_amount 78 non-null float64 \n",
|
405 |
+
" 9 outcomes_tokens_traded 78 non-null float64 \n",
|
406 |
+
" 10 current_answer 78 non-null int64 \n",
|
407 |
+
" 11 is_invalid 78 non-null bool \n",
|
408 |
+
" 12 winning_trade 78 non-null bool \n",
|
409 |
+
" 13 earnings 78 non-null float64 \n",
|
410 |
+
" 14 redeemed 78 non-null bool \n",
|
411 |
+
" 15 redeemed_amount 78 non-null float64 \n",
|
412 |
+
" 16 num_mech_calls 78 non-null int64 \n",
|
413 |
+
" 17 mech_fee_amount 78 non-null float64 \n",
|
414 |
+
" 18 net_earnings 78 non-null float64 \n",
|
415 |
+
" 19 roi 78 non-null float64 \n",
|
416 |
+
" 20 staking 78 non-null object \n",
|
417 |
+
" 21 creation_date 78 non-null object \n",
|
418 |
+
" 22 month_year_week 78 non-null object \n",
|
419 |
+
"dtypes: bool(3), datetime64[ns, UTC](1), float64(8), int64(2), object(9)\n",
|
420 |
+
"memory usage: 13.0+ KB\n"
|
421 |
+
]
|
422 |
+
}
|
423 |
+
],
|
424 |
+
"source": [
|
425 |
+
"trader_data.info()"
|
426 |
+
]
|
427 |
+
},
|
428 |
+
{
|
429 |
+
"cell_type": "code",
|
430 |
+
"execution_count": 13,
|
431 |
+
"metadata": {},
|
432 |
+
"outputs": [
|
433 |
+
{
|
434 |
+
"data": {
|
435 |
+
"text/plain": [
|
436 |
+
"count 78.000000\n",
|
437 |
+
"mean 172.166667\n",
|
438 |
+
"std 73.238698\n",
|
439 |
+
"min 1.000000\n",
|
440 |
+
"25% 206.000000\n",
|
441 |
+
"50% 206.000000\n",
|
442 |
+
"75% 206.000000\n",
|
443 |
+
"max 206.000000\n",
|
444 |
+
"Name: num_mech_calls, dtype: float64"
|
445 |
+
]
|
446 |
+
},
|
447 |
+
"execution_count": 13,
|
448 |
+
"metadata": {},
|
449 |
+
"output_type": "execute_result"
|
450 |
+
}
|
451 |
+
],
|
452 |
+
"source": [
|
453 |
+
"trader_data.num_mech_calls.describe()"
|
454 |
+
]
|
455 |
+
},
|
456 |
+
{
|
457 |
+
"cell_type": "code",
|
458 |
+
"execution_count": 14,
|
459 |
+
"metadata": {},
|
460 |
+
"outputs": [],
|
461 |
+
"source": [
|
462 |
+
"trader_data_selected = trader_data.loc[trader_data[\"num_mech_calls\"]>200]"
|
463 |
+
]
|
464 |
+
},
|
465 |
+
{
|
466 |
+
"cell_type": "code",
|
467 |
+
"execution_count": 15,
|
468 |
+
"metadata": {},
|
469 |
+
"outputs": [
|
470 |
+
{
|
471 |
+
"name": "stdout",
|
472 |
+
"output_type": "stream",
|
473 |
+
"text": [
|
474 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
475 |
+
"Index: 64 entries, 26553 to 26582\n",
|
476 |
+
"Data columns (total 23 columns):\n",
|
477 |
+
" # Column Non-Null Count Dtype \n",
|
478 |
+
"--- ------ -------------- ----- \n",
|
479 |
+
" 0 trader_address 64 non-null object \n",
|
480 |
+
" 1 market_creator 64 non-null object \n",
|
481 |
+
" 2 trade_id 64 non-null object \n",
|
482 |
+
" 3 creation_timestamp 64 non-null datetime64[ns, UTC]\n",
|
483 |
+
" 4 title 64 non-null object \n",
|
484 |
+
" 5 market_status 64 non-null object \n",
|
485 |
+
" 6 collateral_amount 64 non-null float64 \n",
|
486 |
+
" 7 outcome_index 64 non-null object \n",
|
487 |
+
" 8 trade_fee_amount 64 non-null float64 \n",
|
488 |
+
" 9 outcomes_tokens_traded 64 non-null float64 \n",
|
489 |
+
" 10 current_answer 64 non-null int64 \n",
|
490 |
+
" 11 is_invalid 64 non-null bool \n",
|
491 |
+
" 12 winning_trade 64 non-null bool \n",
|
492 |
+
" 13 earnings 64 non-null float64 \n",
|
493 |
+
" 14 redeemed 64 non-null bool \n",
|
494 |
+
" 15 redeemed_amount 64 non-null float64 \n",
|
495 |
+
" 16 num_mech_calls 64 non-null int64 \n",
|
496 |
+
" 17 mech_fee_amount 64 non-null float64 \n",
|
497 |
+
" 18 net_earnings 64 non-null float64 \n",
|
498 |
+
" 19 roi 64 non-null float64 \n",
|
499 |
+
" 20 staking 64 non-null object \n",
|
500 |
+
" 21 creation_date 64 non-null object \n",
|
501 |
+
" 22 month_year_week 64 non-null object \n",
|
502 |
+
"dtypes: bool(3), datetime64[ns, UTC](1), float64(8), int64(2), object(9)\n",
|
503 |
+
"memory usage: 10.7+ KB\n"
|
504 |
+
]
|
505 |
+
}
|
506 |
+
],
|
507 |
+
"source": [
|
508 |
+
"trader_data_selected.info()"
|
509 |
+
]
|
510 |
+
},
|
511 |
+
{
|
512 |
+
"cell_type": "code",
|
513 |
+
"execution_count": 16,
|
514 |
+
"metadata": {},
|
515 |
+
"outputs": [
|
516 |
+
{
|
517 |
+
"data": {
|
518 |
+
"text/plain": [
|
519 |
+
"title\n",
|
520 |
+
"Will the U.S. Congress hold a hearing to discuss the security threats faced by former U.S. Presidents before November 1, 2024? 64\n",
|
521 |
+
"Name: count, dtype: int64"
|
522 |
+
]
|
523 |
+
},
|
524 |
+
"execution_count": 16,
|
525 |
+
"metadata": {},
|
526 |
+
"output_type": "execute_result"
|
527 |
+
}
|
528 |
+
],
|
529 |
+
"source": [
|
530 |
+
"trader_data_selected.title.value_counts()"
|
531 |
+
]
|
532 |
+
},
|
533 |
+
{
|
534 |
+
"cell_type": "code",
|
535 |
+
"execution_count": 17,
|
536 |
+
"metadata": {},
|
537 |
+
"outputs": [
|
538 |
+
{
|
539 |
+
"data": {
|
540 |
+
"text/plain": [
|
541 |
+
"creation_date\n",
|
542 |
+
"2024-10-29 32\n",
|
543 |
+
"2024-10-30 29\n",
|
544 |
+
"2024-10-28 3\n",
|
545 |
+
"Name: count, dtype: int64"
|
546 |
+
]
|
547 |
+
},
|
548 |
+
"execution_count": 17,
|
549 |
+
"metadata": {},
|
550 |
+
"output_type": "execute_result"
|
551 |
+
}
|
552 |
+
],
|
553 |
+
"source": [
|
554 |
+
"trader_data_selected.creation_date.value_counts()"
|
555 |
+
]
|
556 |
+
},
|
557 |
+
{
|
558 |
+
"cell_type": "code",
|
559 |
+
"execution_count": null,
|
560 |
+
"metadata": {},
|
561 |
+
"outputs": [],
|
562 |
+
"source": []
|
563 |
+
},
|
564 |
+
{
|
565 |
+
"cell_type": "code",
|
566 |
+
"execution_count": null,
|
567 |
+
"metadata": {},
|
568 |
+
"outputs": [],
|
569 |
+
"source": []
|
570 |
+
},
|
571 |
+
{
|
572 |
+
"cell_type": "code",
|
573 |
+
"execution_count": null,
|
574 |
+
"metadata": {},
|
575 |
+
"outputs": [],
|
576 |
+
"source": []
|
577 |
+
},
|
578 |
+
{
|
579 |
+
"cell_type": "code",
|
580 |
+
"execution_count": null,
|
581 |
+
"metadata": {},
|
582 |
+
"outputs": [],
|
583 |
+
"source": []
|
584 |
+
}
|
585 |
+
],
|
586 |
+
"metadata": {
|
587 |
+
"kernelspec": {
|
588 |
+
"display_name": "hf_dashboards",
|
589 |
+
"language": "python",
|
590 |
+
"name": "python3"
|
591 |
+
},
|
592 |
+
"language_info": {
|
593 |
+
"codemirror_mode": {
|
594 |
+
"name": "ipython",
|
595 |
+
"version": 3
|
596 |
+
},
|
597 |
+
"file_extension": ".py",
|
598 |
+
"mimetype": "text/x-python",
|
599 |
+
"name": "python",
|
600 |
+
"nbconvert_exporter": "python",
|
601 |
+
"pygments_lexer": "ipython3",
|
602 |
+
"version": "3.12.2"
|
603 |
+
}
|
604 |
+
},
|
605 |
+
"nbformat": 4,
|
606 |
+
"nbformat_minor": 2
|
607 |
+
}
|