{ "cells": [ { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "from datasets import load_dataset\n", "import json" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [], "source": [ "for year in [2022,2023]:\n", " for subject in [\"math\"]:\n", " file_orig=f\"./data/json/{year}/{subject}_v1.json\"\n", " file_dest=f\"./data/json/{year}/{subject}.json\"\n", " with open(file_dest,\"w\") as f:\n", " for line in open(file_orig,\"r\"):\n", " data = json.loads(line)\n", " if \"incomplete\" not in data:\n", " data[\"incomplete\"] = False\n", " linewrite=json.dumps(data,ensure_ascii=False)\n", " f.write(linewrite+\"\\n\")" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a98671ee84414941b4533a3e983ba194", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading data files: 0%| | 0/2 [00:00