{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# LOAD LIBRARIES\nimport pandas as pd\nimport numpy as np\nfrom pathlib import Path\nimport matplotlib.pyplot as plt\nimport IPython\nfrom IPython.display import display\nfrom PIL import Image\n%matplotlib inline\nimport random\n","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-03-17T10:57:30.20435Z","iopub.execute_input":"2022-03-17T10:57:30.204899Z","iopub.status.idle":"2022-03-17T10:57:30.231461Z","shell.execute_reply.started":"2022-03-17T10:57:30.204802Z","shell.execute_reply":"2022-03-17T10:57:30.230857Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# LOAD THE DATA\ntrain_csv = pd.read_csv(\"../input/ultra-mnist/train.csv\")\ntrain_csv","metadata":{"execution":{"iopub.status.busy":"2022-03-17T10:57:34.108106Z","iopub.execute_input":"2022-03-17T10:57:34.1084Z","iopub.status.idle":"2022-03-17T10:57:34.162222Z","shell.execute_reply.started":"2022-03-17T10:57:34.108368Z","shell.execute_reply":"2022-03-17T10:57:34.161416Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission = pd.DataFrame([],columns=['id','digit_sum'])\nsubmission","metadata":{"execution":{"iopub.status.busy":"2022-03-17T10:57:40.318268Z","iopub.execute_input":"2022-03-17T10:57:40.318552Z","iopub.status.idle":"2022-03-17T10:57:40.328865Z","shell.execute_reply.started":"2022-03-17T10:57:40.318519Z","shell.execute_reply":"2022-03-17T10:57:40.328163Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission = pd.DataFrame([],columns=['id','digit_sum'])\nimport os\ni = 0\nfor dirname, _, filenames in os.walk('/kaggle/input/ultra-mnist/test'):\n    \n    for filename in filenames:\n        new_row = {'id':filename.replace('.jpeg',''), 'digit_sum':random.randint(0,28)}\n        #print(new_row)\n        submission = submission.append(new_row, ignore_index=True)\n\n        \n","metadata":{"scrolled":true,"execution":{"iopub.status.busy":"2022-03-17T10:57:41.972877Z","iopub.execute_input":"2022-03-17T10:57:41.973163Z","iopub.status.idle":"2022-03-17T10:59:13.409222Z","shell.execute_reply.started":"2022-03-17T10:57:41.973129Z","shell.execute_reply":"2022-03-17T10:59:13.408248Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-17T10:59:20.949509Z","iopub.execute_input":"2022-03-17T10:59:20.949936Z","iopub.status.idle":"2022-03-17T10:59:20.965003Z","shell.execute_reply.started":"2022-03-17T10:59:20.949891Z","shell.execute_reply":"2022-03-17T10:59:20.964053Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission","metadata":{"scrolled":true,"execution":{"iopub.status.busy":"2022-03-17T10:59:23.911502Z","iopub.execute_input":"2022-03-17T10:59:23.9118Z","iopub.status.idle":"2022-03-17T10:59:23.925433Z","shell.execute_reply.started":"2022-03-17T10:59:23.911758Z","shell.execute_reply":"2022-03-17T10:59:23.924577Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission.to_csv(\"submission.csv\",index=False)","metadata":{"execution":{"iopub.status.busy":"2022-03-17T10:59:25.05344Z","iopub.execute_input":"2022-03-17T10:59:25.053726Z","iopub.status.idle":"2022-03-17T10:59:25.120987Z","shell.execute_reply.started":"2022-03-17T10:59:25.053691Z","shell.execute_reply":"2022-03-17T10:59:25.119911Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}