{"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":"try:\n    import pylibjpeg\nexcept:\n    # Offline dependencies:\n    !mkdir -p /root/.cache/torch/hub/checkpoints/\n    !cp ../input/rsna-2022-whl/efficientnet_v2_s-dd5fe13b.pth  /root/.cache/torch/hub/checkpoints/\n\n    !pip install /kaggle/input/rsna-2022-whl/{pydicom-2.3.0-py3-none-any.whl,pylibjpeg-1.4.0-py3-none-any.whl,python_gdcm-3.0.15-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl}\n    !pip install /kaggle/input/rsna-2022-whl/{torch-1.12.1-cp37-cp37m-manylinux1_x86_64.whl,torchvision-0.13.1-cp37-cp37m-manylinux1_x86_64.whl}","metadata":{"execution":{"iopub.status.busy":"2022-10-25T06:14:43.810429Z","iopub.execute_input":"2022-10-25T06:14:43.810758Z","iopub.status.idle":"2022-10-25T06:16:36.212968Z","shell.execute_reply.started":"2022-10-25T06:14:43.810685Z","shell.execute_reply":"2022-10-25T06:16:36.211786Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import gc\nimport glob\nimport os\nimport re\n\nimport cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n# import pydicom as dicom\nimport pydicom\nimport torch\nimport torchvision as tv\nfrom sklearn.model_selection import GroupKFold\nfrom torch.cuda.amp import GradScaler, autocast\nfrom torchvision.models.feature_extraction import create_feature_extractor\nfrom tqdm.notebook import tqdm\nimport albumentations\n\nDEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'\n\npd.set_option('display.max_rows', 1000)\npd.set_option('display.max_columns', 1000)\nplt.rcParams['figure.figsize'] = (20, 5)\n\n\n# Effnet\n# WEIGHTS = tv.models.efficientnet.EfficientNet_V2_M_Weights.DEFAULT\nRSNA_2022_PATH = '../input/rsna-2022-cervical-spine-fracture-detection'\n# TRAIN_IMAGES_PATH = f'{RSNA_2022_PATH}/train_images'\nTEST_IMAGES_PATH = f'{RSNA_2022_PATH}/test_images'\nEFFNET_CHECKPOINTS_PATH = '../input/rsna2022/base8'\n\n# MODEL_NAMES = [f'effnetv2']\n\n# This notebook supports ensembles and single model predictions. Uncomment to switch to ensemble prediction:\nMODEL_NAMES = [f'effnetv2-f{i}' for i in range(5)]\n\n# Common\nFRAC_COLS = [f'C{i}_effnet_frac' for i in range(1, 8)]\nVERT_COLS = [f'C{i}_effnet_vert' for i in range(1, 8)]\nBATCH_SIZE = 32","metadata":{"papermill":{"duration":2.969425,"end_time":"2022-08-29T06:36:21.083846","exception":false,"start_time":"2022-08-29T06:36:18.114421","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:16:36.215812Z","iopub.execute_input":"2022-10-25T06:16:36.216212Z","iopub.status.idle":"2022-10-25T06:16:38.715428Z","shell.execute_reply.started":"2022-10-25T06:16:36.21617Z","shell.execute_reply":"2022-10-25T06:16:38.714427Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def load_df_test():\n    df_test = pd.read_csv(f'{RSNA_2022_PATH}/test.csv')\n\n    if df_test.iloc[0].row_id == '1.2.826.0.1.3680043.10197_C1':\n        # test_images and test.csv are inconsistent in the dev dataset, fixing labels for the dev run.\n        df_test = pd.DataFrame({\n            \"row_id\": ['1.2.826.0.1.3680043.22327_C1', '1.2.826.0.1.3680043.25399_C1', '1.2.826.0.1.3680043.5876_C1'],\n            \"StudyInstanceUID\": ['1.2.826.0.1.3680043.22327', '1.2.826.0.1.3680043.25399', '1.2.826.0.1.3680043.5876'],\n            \"prediction_type\": [\"C1\", \"C1\", \"patient_overall\"]}\n        )\n    return df_test\n\ndf_test = load_df_test()\ndf_test","metadata":{"papermill":{"duration":0.045491,"end_time":"2022-08-29T06:36:21.148473","exception":false,"start_time":"2022-08-29T06:36:21.102982","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:16:38.717057Z","iopub.execute_input":"2022-10-25T06:16:38.717659Z","iopub.status.idle":"2022-10-25T06:16:38.75244Z","shell.execute_reply.started":"2022-10-25T06:16:38.717621Z","shell.execute_reply":"2022-10-25T06:16:38.751529Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_slices = glob.glob(f'{TEST_IMAGES_PATH}/*/*')\ntest_slices = [re.findall(f'{TEST_IMAGES_PATH}/(.*)/(.*).dcm', s)[0] for s in test_slices]\ndf_test_slices = pd.DataFrame(data=test_slices, columns=['StudyInstanceUID', 'Slice']).astype({'Slice': int}).sort_values(['StudyInstanceUID', 'Slice']).reset_index(drop=True)\ndf_test_slices.head()","metadata":{"papermill":{"duration":0.145663,"end_time":"2022-08-29T06:36:21.302098","exception":false,"start_time":"2022-08-29T06:36:21.156435","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:16:38.754916Z","iopub.execute_input":"2022-10-25T06:16:38.755535Z","iopub.status.idle":"2022-10-25T06:16:39.027191Z","shell.execute_reply.started":"2022-10-25T06:16:38.755499Z","shell.execute_reply":"2022-10-25T06:16:39.02613Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# def load_dicom(path):\n#     \"\"\"\n#     This supports loading both regular and compressed JPEG images. \n#     See the first sell with `pip install` commands for the necessary dependencies\n#     \"\"\"\n#     img=dicom.dcmread(path)\n#     img.PhotometricInterpretation = 'YBR_FULL'\n#     data = img.pixel_array    \n#     data = data - np.min(data)\n#     if np.max(data) != 0:\n#         data = data / np.max(data)\n#     data=(data * 255).astype(np.uint8)\n#     return cv2.cvtColor(data, cv2.COLOR_GRAY2RGB), img\n\ndef get_first_of_dicom_field_as_int(x):\n    if type(x) == pydicom.multival.MultiValue:\n        return int(x[0])\n    return int(x)\n\ndef normalize_minmax(img):\n    mi, ma = img.min(), img.max()\n    return (img - mi) / (ma - mi)\n\ndef get_metadata_from_dicom(img_dicom):\n    \n    metadata = {\n        \"window_center\": img_dicom.WindowCenter,\n        \"window_width\": img_dicom.WindowWidth,\n        \"intercept\": img_dicom.RescaleIntercept,\n        \"slope\": img_dicom.RescaleSlope,\n    }\n    return {k: get_first_of_dicom_field_as_int(v) for k, v in metadata.items()}\n\ndef window_image(img, window_center, window_width, intercept, slope):\n    img = img * slope + intercept\n    img_min = window_center - window_width // 2\n    img_max = window_center + window_width // 2\n    img[img < img_min] = img_min\n    img[img > img_max] = img_max\n    return img \n\ndef load_dicom(path):\n    \"\"\"\n    This supports loading both regular and compressed JPEG images.\n    See the first sell with `pip install` commands for the necessary dependencies\n    \"\"\"\n    # img = dicom.dcmread(path)\n    # img.PhotometricInterpretation = 'YBR_FULL'\n    # data = img.pixel_array\n    # data = data - np.min(data)\n    # if np.max(data) != 0:\n    #     data = data / np.max(data)\n    img_dicom = pydicom.read_file(path)\n    # img_id = get_id(img_dicom)\n    metadata = get_metadata_from_dicom(img_dicom)\n    # print(metadata)\n    img = window_image(img_dicom.pixel_array, **metadata)\n    # img = normalize_minmax(img) * 255\n    # img = img.astype(np.int8)\n    # print(img)\n    # print(img.shape)\n    data = (normalize_minmax(img)  * 255).astype(np.uint8)\n    # return img, img\n    return cv2.cvtColor(data, cv2.COLOR_GRAY2RGB), img\n","metadata":{"papermill":{"duration":0.619183,"end_time":"2022-08-29T06:36:21.941518","exception":false,"start_time":"2022-08-29T06:36:21.322335","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:16:39.028913Z","iopub.execute_input":"2022-10-25T06:16:39.029287Z","iopub.status.idle":"2022-10-25T06:16:39.040694Z","shell.execute_reply.started":"2022-10-25T06:16:39.029249Z","shell.execute_reply":"2022-10-25T06:16:39.039714Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"class EffnetDataSet(torch.utils.data.Dataset):    \n    def __init__(self, df, path, transforms=None):\n        super().__init__()\n        self.df = df\n        self.path = path\n        self.transforms = transforms\n        \n    def __getitem__(self, i):\n        path = os.path.join(self.path, self.df.iloc[i].StudyInstanceUID, f'{self.df.iloc[i].Slice}.dcm')        \n        \n        try:\n            img = load_dicom(path)[0]         \n#             img = np.transpose(img, (2, 0, 1))  # Pytorch uses (batch, channel, height, width) order. Converting (height, width, channel) -> (channel, height, width)\n            if self.transforms is not None:\n#                 img = self.transforms(torch.as_tensor(img))\n                img = self.transforms(image=img)['image'].transpose(2, 0, 1)\n        except Exception as ex:\n            print(ex)\n            return None\n        \n        if 'C1_fracture' in self.df:\n            frac_targets = torch.as_tensor(self.df.iloc[i][['C1_fracture', 'C2_fracture', 'C3_fracture', 'C4_fracture', 'C5_fracture', 'C6_fracture', 'C7_fracture']].astype('float32').values)\n            vert_targets = torch.as_tensor(self.df.iloc[i][['C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7']].astype('float32').values)\n            frac_targets = frac_targets * vert_targets   # we only enable targets that are visible on the current slice\n            return img, frac_targets, vert_targets\n        return img        \n    \n    def __len__(self):\n        return len(self.df)\n    ","metadata":{"papermill":{"duration":0.023057,"end_time":"2022-08-29T06:36:21.974596","exception":false,"start_time":"2022-08-29T06:36:21.951539","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:16:39.042304Z","iopub.execute_input":"2022-10-25T06:16:39.042779Z","iopub.status.idle":"2022-10-25T06:16:39.05292Z","shell.execute_reply.started":"2022-10-25T06:16:39.042745Z","shell.execute_reply":"2022-10-25T06:16:39.051732Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Only X values returned by the test dataset\ntransforms = albumentations.Compose([\n                    albumentations.Resize(480, 480),\n                    albumentations.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225), max_pixel_value=255.0, p=1.0)\n            ])\n    \nds_test = EffnetDataSet(df_test_slices, TEST_IMAGES_PATH, transforms)\nX = ds_test[42]\nX.shape","metadata":{"papermill":{"duration":0.04504,"end_time":"2022-08-29T06:36:22.02892","exception":false,"start_time":"2022-08-29T06:36:21.98388","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:16:39.054503Z","iopub.execute_input":"2022-10-25T06:16:39.054866Z","iopub.status.idle":"2022-10-25T06:16:39.116455Z","shell.execute_reply.started":"2022-10-25T06:16:39.054831Z","shell.execute_reply":"2022-10-25T06:16:39.115467Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"class EffnetModel(torch.nn.Module):\n    def __init__(self):\n        super().__init__()\n        effnet = tv.models.efficientnet_v2_m()\n        self.model = create_feature_extractor(effnet, ['flatten'])\n        self.nn_fracture = torch.nn.Sequential(\n            torch.nn.Linear(1280, 7),\n        )\n        self.nn_vertebrae = torch.nn.Sequential(\n            torch.nn.Linear(1280, 7),\n        )\n\n    def forward(self, x):\n        # returns logits\n        x = self.model(x)['flatten']\n        return self.nn_fracture(x), self.nn_vertebrae(x)\n\n    def predict(self, x):\n        frac, vert = self.forward(x)\n        return torch.sigmoid(frac), torch.sigmoid(vert)\n\n# model = EffnetModel()\n# model.predict(torch.randn(1, 3, 512, 512))\n# del model","metadata":{"papermill":{"duration":2.094724,"end_time":"2022-08-29T06:36:24.151144","exception":false,"start_time":"2022-08-29T06:36:22.05642","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:16:39.117893Z","iopub.execute_input":"2022-10-25T06:16:39.118242Z","iopub.status.idle":"2022-10-25T06:16:39.126945Z","shell.execute_reply.started":"2022-10-25T06:16:39.118208Z","shell.execute_reply":"2022-10-25T06:16:39.12473Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def load_model(model, name, path='.'):\n    data = torch.load(os.path.join(path, f'{name}.pth'), map_location=DEVICE)\n    model.load_state_dict(data)\n    return model","metadata":{"papermill":{"duration":0.019322,"end_time":"2022-08-29T06:36:24.180428","exception":false,"start_time":"2022-08-29T06:36:24.161106","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:16:39.128712Z","iopub.execute_input":"2022-10-25T06:16:39.129518Z","iopub.status.idle":"2022-10-25T06:16:39.139631Z","shell.execute_reply.started":"2022-10-25T06:16:39.129482Z","shell.execute_reply":"2022-10-25T06:16:39.138537Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"effnet_models = [load_model(EffnetModel(), name, EFFNET_CHECKPOINTS_PATH).to(DEVICE) for name in MODEL_NAMES]","metadata":{"papermill":{"duration":4.116502,"end_time":"2022-08-29T06:36:28.306547","exception":false,"start_time":"2022-08-29T06:36:24.190045","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:16:39.143483Z","iopub.execute_input":"2022-10-25T06:16:39.143786Z","iopub.status.idle":"2022-10-25T06:16:59.611579Z","shell.execute_reply.started":"2022-10-25T06:16:39.143742Z","shell.execute_reply":"2022-10-25T06:16:59.610478Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from typing import List\n\ndef predict_effnet(models: List[EffnetModel], ds, max_batches=1e9):\n    dl_test = torch.utils.data.DataLoader(ds, batch_size=BATCH_SIZE, shuffle=False, num_workers=os.cpu_count())\n    for m in models:\n        m.eval()\n\n    with torch.no_grad():\n        predictions = []\n        for idx, X in enumerate(tqdm(dl_test, miniters=10)):\n            pred = torch.zeros(len(X), 14).to(DEVICE)\n            for m in models:\n                y1, y2 = m.predict(X.to(DEVICE))\n                pred += torch.concat([y1, y2], dim=1) / len(models)\n            predictions.append(pred)\n            if idx >= max_batches:\n                break\n        return torch.concat(predictions).cpu().numpy()\n\n# Quick test\n# predict_effnet([EffnetModel().to(DEVICE)], ds_test, max_batches=2).shape","metadata":{"collapsed":false,"jupyter":{"outputs_hidden":false},"papermill":{"duration":3.84226,"end_time":"2022-08-29T06:36:32.176344","exception":false,"start_time":"2022-08-29T06:36:28.334084","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:16:59.612953Z","iopub.execute_input":"2022-10-25T06:16:59.613318Z","iopub.status.idle":"2022-10-25T06:16:59.622507Z","shell.execute_reply.started":"2022-10-25T06:16:59.613278Z","shell.execute_reply":"2022-10-25T06:16:59.621513Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"effnet_pred = predict_effnet(effnet_models, ds_test)\n\ndf_effnet_pred = pd.DataFrame(\n    data=effnet_pred, columns=[f'C{i}_effnet_frac' for i in range(1, 8)] + [f'C{i}_effnet_vert' for i in range(1, 8)]\n)","metadata":{"papermill":{"duration":23.579326,"end_time":"2022-08-29T06:36:55.765273","exception":false,"start_time":"2022-08-29T06:36:32.185947","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:16:59.624168Z","iopub.execute_input":"2022-10-25T06:16:59.624942Z","iopub.status.idle":"2022-10-25T06:18:32.867013Z","shell.execute_reply.started":"2022-10-25T06:16:59.624905Z","shell.execute_reply":"2022-10-25T06:18:32.865964Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_test_pred = pd.concat([df_test_slices, df_effnet_pred], axis=1).sort_values(['StudyInstanceUID', 'Slice'])\ndf_test_pred","metadata":{"papermill":{"duration":0.063127,"end_time":"2022-08-29T06:36:55.844489","exception":false,"start_time":"2022-08-29T06:36:55.781362","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:18:32.868928Z","iopub.execute_input":"2022-10-25T06:18:32.869321Z","iopub.status.idle":"2022-10-25T06:18:32.901463Z","shell.execute_reply.started":"2022-10-25T06:18:32.86928Z","shell.execute_reply":"2022-10-25T06:18:32.900466Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def plot_sample_patient(df_pred):\n    patient = np.random.choice(df_pred.StudyInstanceUID)\n    df = df_pred.query('StudyInstanceUID == @patient').reset_index()\n\n    df[[f'C{i}_effnet_frac' for i in range(1, 8)]].plot(\n        title=f'Patient {patient}, fracture prediction',\n        ax=(plt.subplot(1, 2, 1)))\n\n    df[[f'C{i}_effnet_vert' for i in range(1, 8)]].plot(\n        title=f'Patient {patient}, vertebrae prediction',\n        ax=plt.subplot(1, 2, 2)\n    )\n\nplot_sample_patient(df_test_pred)","metadata":{"collapsed":false,"jupyter":{"outputs_hidden":false},"papermill":{"duration":0.629707,"end_time":"2022-08-29T06:36:56.489965","exception":false,"start_time":"2022-08-29T06:36:55.860258","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:18:32.90276Z","iopub.execute_input":"2022-10-25T06:18:32.903109Z","iopub.status.idle":"2022-10-25T06:18:33.682433Z","shell.execute_reply.started":"2022-10-25T06:18:32.903076Z","shell.execute_reply":"2022-10-25T06:18:33.681523Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_test_pred","metadata":{"execution":{"iopub.status.busy":"2022-10-25T06:18:33.683575Z","iopub.execute_input":"2022-10-25T06:18:33.684003Z","iopub.status.idle":"2022-10-25T06:18:33.710116Z","shell.execute_reply.started":"2022-10-25T06:18:33.683972Z","shell.execute_reply":"2022-10-25T06:18:33.709078Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def patient_prediction(df):\n    c1c7 = np.average(df[FRAC_COLS].values, axis=0, weights=df[VERT_COLS].values)\n#     pred_patient_overall = 1 - np.prod(1 - c1c7)\n    pred_patient_overall = np.max(c1c7)\n    return pd.Series(data=np.concatenate([[pred_patient_overall], c1c7]), index=['patient_overall'] + [f'C{i}' for i in range(1, 8)])\n\ndf_patient_pred = df_test_pred.groupby('StudyInstanceUID').apply(lambda df: patient_prediction(df))\ndf_patient_pred","metadata":{"collapsed":false,"jupyter":{"outputs_hidden":false},"papermill":{"duration":0.038032,"end_time":"2022-08-29T06:36:56.54117","exception":false,"start_time":"2022-08-29T06:36:56.503138","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:18:33.711859Z","iopub.execute_input":"2022-10-25T06:18:33.712291Z","iopub.status.idle":"2022-10-25T06:18:33.738849Z","shell.execute_reply.started":"2022-10-25T06:18:33.712255Z","shell.execute_reply":"2022-10-25T06:18:33.737872Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_sub = df_test.copy()\ndf_sub = df_sub.set_index('StudyInstanceUID').join(df_patient_pred)\ndf_sub['fractured'] = df_sub.apply(lambda r: r[r.prediction_type], axis=1)\ndf_sub","metadata":{"collapsed":false,"jupyter":{"outputs_hidden":false},"papermill":{"duration":0.036645,"end_time":"2022-08-29T06:36:56.590835","exception":false,"start_time":"2022-08-29T06:36:56.55419","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:18:33.740443Z","iopub.execute_input":"2022-10-25T06:18:33.740813Z","iopub.status.idle":"2022-10-25T06:18:33.760634Z","shell.execute_reply.started":"2022-10-25T06:18:33.74078Z","shell.execute_reply":"2022-10-25T06:18:33.759698Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_sub[['row_id', 'fractured']].to_csv('submission.csv', index=False)","metadata":{"papermill":{"duration":0.024447,"end_time":"2022-08-29T06:36:56.629233","exception":false,"start_time":"2022-08-29T06:36:56.604786","status":"completed"},"pycharm":{"name":"#%%\n"},"tags":[],"execution":{"iopub.status.busy":"2022-10-25T06:18:33.762322Z","iopub.execute_input":"2022-10-25T06:18:33.762983Z","iopub.status.idle":"2022-10-25T06:18:33.772381Z","shell.execute_reply.started":"2022-10-25T06:18:33.762949Z","shell.execute_reply":"2022-10-25T06:18:33.771618Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_sub","metadata":{"execution":{"iopub.status.busy":"2022-10-25T06:18:33.77404Z","iopub.execute_input":"2022-10-25T06:18:33.77473Z","iopub.status.idle":"2022-10-25T06:18:33.790521Z","shell.execute_reply.started":"2022-10-25T06:18:33.774692Z","shell.execute_reply":"2022-10-25T06:18:33.789802Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}