Spaces:
Running
Running
Merge pull request #6 from alecrem/add-box-sets
Browse files- middleschool-cardlist.ipynb +20 -13
- output/middleschool.csv +0 -0
- output/middleschool.json +0 -0
middleschool-cardlist.ipynb
CHANGED
@@ -34,7 +34,7 @@
|
|
34 |
},
|
35 |
{
|
36 |
"cell_type": "code",
|
37 |
-
"execution_count":
|
38 |
"metadata": {},
|
39 |
"outputs": [],
|
40 |
"source": [
|
@@ -42,7 +42,7 @@
|
|
42 |
" 'WTH', 'POR', 'TMP', 'STH', 'EXO', 'P02', 'USG', 'ULG',\n",
|
43 |
" '6ED', 'UDS', 'PTK', 'S99', 'MMQ', 'NEM', 'PCY', 'S00',\n",
|
44 |
" 'INV', 'PLS', '7ED', 'APC', 'ODY', 'TOR', 'JUD', 'ONS',\n",
|
45 |
-
" 'LGN', 'SCG', 'PDRC', 'PHPR']\n",
|
46 |
"for set in setlist:\n",
|
47 |
" command = 'cat data/AllPrintings.json | jq \\'.data.\\\"' + \\\n",
|
48 |
" set + '\\\".cards\\' > data/set_' + set + '.json'\n",
|
@@ -58,7 +58,7 @@
|
|
58 |
},
|
59 |
{
|
60 |
"cell_type": "code",
|
61 |
-
"execution_count":
|
62 |
"metadata": {},
|
63 |
"outputs": [],
|
64 |
"source": [
|
@@ -75,14 +75,19 @@
|
|
75 |
},
|
76 |
{
|
77 |
"cell_type": "code",
|
78 |
-
"execution_count":
|
79 |
"metadata": {},
|
80 |
"outputs": [
|
81 |
{
|
82 |
"name": "stdout",
|
83 |
"output_type": "stream",
|
84 |
"text": [
|
85 |
-
"
|
|
|
|
|
|
|
|
|
|
|
86 |
" oracle_id name name_ja\n",
|
87 |
"0 8adbba6e-03ef-4278-aec5-8a4496b377a8 Abandon Hope 断念\n",
|
88 |
"0 5a70ccfa-d12d-4e62-a1a4-f05cda2fd442 Abandoned Outpost 見捨てられた前哨地\n",
|
@@ -123,8 +128,10 @@
|
|
123 |
" })\n",
|
124 |
" middleschool_df = pd.concat([middleschool_df, temporary_df])\n",
|
125 |
"\n",
|
|
|
|
|
126 |
"middleschool_df = middleschool_df.drop_duplicates(subset=['oracle_id'])\n",
|
127 |
-
"middleschool_df
|
128 |
"print(middleschool_df.shape[0], 'cards found')\n",
|
129 |
"print(middleschool_df.head())\n",
|
130 |
"print(middleschool_df.tail())\n"
|
@@ -139,16 +146,16 @@
|
|
139 |
},
|
140 |
{
|
141 |
"cell_type": "code",
|
142 |
-
"execution_count":
|
143 |
"metadata": {},
|
144 |
"outputs": [
|
145 |
{
|
146 |
"name": "stdout",
|
147 |
"output_type": "stream",
|
148 |
"text": [
|
149 |
-
"Cards legal by set:
|
150 |
"Banned cards: 26\n",
|
151 |
-
"Cards legal by set and not banned:
|
152 |
]
|
153 |
}
|
154 |
],
|
@@ -181,7 +188,7 @@
|
|
181 |
" \"Yawgmoth's Will\"]\n",
|
182 |
"print('Cards legal by set:', middleschool_df.shape[0])\n",
|
183 |
"banned_df = middleschool_df[pd.DataFrame(\n",
|
184 |
-
" middleschool_df.name.tolist()).isin(banlist).any(1).values]\n",
|
185 |
"print('Banned cards:', banned_df.shape[0])\n",
|
186 |
"middleschool_df = pd.concat(\n",
|
187 |
" [middleschool_df, banned_df]).drop_duplicates(keep=False)\n",
|
@@ -199,7 +206,7 @@
|
|
199 |
},
|
200 |
{
|
201 |
"cell_type": "code",
|
202 |
-
"execution_count":
|
203 |
"metadata": {},
|
204 |
"outputs": [],
|
205 |
"source": [
|
@@ -217,7 +224,7 @@
|
|
217 |
],
|
218 |
"metadata": {
|
219 |
"kernelspec": {
|
220 |
-
"display_name": "Python 3
|
221 |
"language": "python",
|
222 |
"name": "python3"
|
223 |
},
|
@@ -231,7 +238,7 @@
|
|
231 |
"name": "python",
|
232 |
"nbconvert_exporter": "python",
|
233 |
"pygments_lexer": "ipython3",
|
234 |
-
"version": "3.
|
235 |
},
|
236 |
"orig_nbformat": 4,
|
237 |
"vscode": {
|
|
|
34 |
},
|
35 |
{
|
36 |
"cell_type": "code",
|
37 |
+
"execution_count": 1,
|
38 |
"metadata": {},
|
39 |
"outputs": [],
|
40 |
"source": [
|
|
|
42 |
" 'WTH', 'POR', 'TMP', 'STH', 'EXO', 'P02', 'USG', 'ULG',\n",
|
43 |
" '6ED', 'UDS', 'PTK', 'S99', 'MMQ', 'NEM', 'PCY', 'S00',\n",
|
44 |
" 'INV', 'PLS', '7ED', 'APC', 'ODY', 'TOR', 'JUD', 'ONS',\n",
|
45 |
+
" 'LGN', 'SCG', 'PDRC', 'PHPR', 'ATH', 'BRB', 'BTD', 'DKM']\n",
|
46 |
"for set in setlist:\n",
|
47 |
" command = 'cat data/AllPrintings.json | jq \\'.data.\\\"' + \\\n",
|
48 |
" set + '\\\".cards\\' > data/set_' + set + '.json'\n",
|
|
|
58 |
},
|
59 |
{
|
60 |
"cell_type": "code",
|
61 |
+
"execution_count": 2,
|
62 |
"metadata": {},
|
63 |
"outputs": [],
|
64 |
"source": [
|
|
|
75 |
},
|
76 |
{
|
77 |
"cell_type": "code",
|
78 |
+
"execution_count": 18,
|
79 |
"metadata": {},
|
80 |
"outputs": [
|
81 |
{
|
82 |
"name": "stdout",
|
83 |
"output_type": "stream",
|
84 |
"text": [
|
85 |
+
" oracle_id name name_ja\n",
|
86 |
+
"0 5acc8b39-3c3e-4012-8cfd-ac3c2c4ca982 Arc Lightning 弧状の稲妻\n",
|
87 |
+
"0 5acc8b39-3c3e-4012-8cfd-ac3c2c4ca982 Arc Lightning None\n",
|
88 |
+
" oracle_id name name_ja\n",
|
89 |
+
"0 5acc8b39-3c3e-4012-8cfd-ac3c2c4ca982 Arc Lightning 弧状の稲妻\n",
|
90 |
+
"5800 cards found\n",
|
91 |
" oracle_id name name_ja\n",
|
92 |
"0 8adbba6e-03ef-4278-aec5-8a4496b377a8 Abandon Hope 断念\n",
|
93 |
"0 5a70ccfa-d12d-4e62-a1a4-f05cda2fd442 Abandoned Outpost 見捨てられた前哨地\n",
|
|
|
128 |
" })\n",
|
129 |
" middleschool_df = pd.concat([middleschool_df, temporary_df])\n",
|
130 |
"\n",
|
131 |
+
"middleschool_df = middleschool_df.sort_values(by=['name', 'name_ja'])\n",
|
132 |
+
"print(middleschool_df[middleschool_df['name'] == 'Arc Lightning'])\n",
|
133 |
"middleschool_df = middleschool_df.drop_duplicates(subset=['oracle_id'])\n",
|
134 |
+
"print(middleschool_df[middleschool_df['name'] == 'Arc Lightning'])\n",
|
135 |
"print(middleschool_df.shape[0], 'cards found')\n",
|
136 |
"print(middleschool_df.head())\n",
|
137 |
"print(middleschool_df.tail())\n"
|
|
|
146 |
},
|
147 |
{
|
148 |
"cell_type": "code",
|
149 |
+
"execution_count": 19,
|
150 |
"metadata": {},
|
151 |
"outputs": [
|
152 |
{
|
153 |
"name": "stdout",
|
154 |
"output_type": "stream",
|
155 |
"text": [
|
156 |
+
"Cards legal by set: 5800\n",
|
157 |
"Banned cards: 26\n",
|
158 |
+
"Cards legal by set and not banned: 5774\n"
|
159 |
]
|
160 |
}
|
161 |
],
|
|
|
188 |
" \"Yawgmoth's Will\"]\n",
|
189 |
"print('Cards legal by set:', middleschool_df.shape[0])\n",
|
190 |
"banned_df = middleschool_df[pd.DataFrame(\n",
|
191 |
+
" middleschool_df.name.tolist()).isin(banlist).any(axis=1).values]\n",
|
192 |
"print('Banned cards:', banned_df.shape[0])\n",
|
193 |
"middleschool_df = pd.concat(\n",
|
194 |
" [middleschool_df, banned_df]).drop_duplicates(keep=False)\n",
|
|
|
206 |
},
|
207 |
{
|
208 |
"cell_type": "code",
|
209 |
+
"execution_count": 20,
|
210 |
"metadata": {},
|
211 |
"outputs": [],
|
212 |
"source": [
|
|
|
224 |
],
|
225 |
"metadata": {
|
226 |
"kernelspec": {
|
227 |
+
"display_name": "Python 3",
|
228 |
"language": "python",
|
229 |
"name": "python3"
|
230 |
},
|
|
|
238 |
"name": "python",
|
239 |
"nbconvert_exporter": "python",
|
240 |
"pygments_lexer": "ipython3",
|
241 |
+
"version": "3.10.8"
|
242 |
},
|
243 |
"orig_nbformat": 4,
|
244 |
"vscode": {
|
output/middleschool.csv
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
output/middleschool.json
CHANGED
The diff for this file is too large to render.
See raw diff
|
|