{"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":"!pip install dicomsdl","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import dicomsdl as dicom, os, pandas as pd, time, joblib\nst = time.time()\nprint(\"start\")\nlenv = 32000\ndef process(i,r):\n    print(\".\",end=\"\")\n    f=f\"/kaggle/input/rsna-breast-cancer-detection/train_images/{r['patient_id']}/{r['image_id']}.dcm\"\n    dicom.open(f).pixelData()\n    \ndf = pd.read_csv(\"/kaggle/input/rsna-breast-cancer-detection/train.csv\")\nwith joblib.Parallel(n_jobs=2) as parallel:\n    parallel(joblib.delayed(process)(i,r) for i,r in df[0:lenv].iterrows())\nprint((time.time() - st)/lenv)\n","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"execution_count":null,"outputs":[]}]}