{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"import numpy as np # MATH\nimport pandas as pd # EATS BAMBOO\nimport gc # TRASHY\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"train_dtypes = {\n    'row_id': np.int64,\n    'timestamp': np.int64,\n    'user_id': np.int32,\n    'content_id': np.int16,\n    'content_type_id': 'boolean',\n    'task_container_id': np.int16,\n    'user_answer': np.int8,\n    'answered_correctly': np.int8,\n    'prior_question_elapsed_time': np.float32,\n    #'prior_question_had_explanation': np.float32\n}\n\nlecture_dtypes = {\n    'lecture_id': np.int32,\n    'tag': np.int32,\n    'part': np.int8\n}\n\nquestion_dtypes = {\n    'question_id': np.int32,\n    'bundle_id': np.int32,\n    'correct_answer': np.int8,\n    'part': np.int8,\n}","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","trusted":true},"cell_type":"code","source":"%%time\nlectures = pd.read_csv('/kaggle/input/riiid-test-answer-prediction/lectures.csv', dtype=lecture_dtypes)\ntrain = pd.read_csv(\"/kaggle/input/riiid-test-answer-prediction/train.csv\", dtype=train_dtypes)\nquestions = pd.read_csv('/kaggle/input/riiid-test-answer-prediction/questions.csv', dtype=question_dtypes)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"train.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"train.prior_question_had_explanation = train.prior_question_had_explanation.map({True: 1, False: 0}).astype(np.float32)\n#train.prior_question_had_explanation.map({True: 1, False: 0}).astype('Int8')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"train.to_feather('train.feather')\nlectures.to_feather('lectures.feather')\nquestions.to_feather('questions.feather')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"del train\ndel lectures\ndel questions\ngc.collect()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"%%time\ntrain = pd.read_feather('train.feather')\nlectures = pd.read_feather('lectures.feather')\nquestions = pd.read_feather('questions.feather')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"train.info()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"train","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"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":4,"nbformat_minor":4}