{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"import json\nimport glob\nimport numpy as np\nimport pandas as pd","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# Add all the file names to a list"},{"metadata":{"trusted":true},"cell_type":"code","source":"#Path to the JSON files\ntrain_files = glob.glob(\"../input/coleridgeinitiative-show-us-the-data/train/*.json\")\ntest_files = glob.glob(\"../input/coleridgeinitiative-show-us-the-data/test/*.json\")","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# Loading all the JSON files"},{"metadata":{"trusted":true},"cell_type":"code","source":"# load json file using pandas\ndf_train = pd.DataFrame()\nfor count,ele in enumerate(train_files,len(train_files)):\n    df_train = pd.concat([df_train, pd.read_json(ele)])\n\ndf_train.to_csv(\"df_train.csv\",index=False)\n\ndf_train","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_test = pd.DataFrame()\nfor count,ele in enumerate(test_files,len(test_files)):\n    df_test = pd.concat([df_test, pd.read_json(ele)])\n\n# convert dataframe to csv file\ndf_test.to_csv(\"df_test.csv\",index=False)\n\ndf_test","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"I think each file start with 'Introduction' and end with 'Future directions:'"}],"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}