{"metadata":{"colab":{"provenance":[],"gpuType":"T4"},"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"accelerator":"GPU"},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import average_precision_score\nfrom sklearn.ensemble import RandomForestClassifier\nimport lightgbm as lgb","metadata":{"id":"4oHSS7C1zO53","execution":{"iopub.status.busy":"2023-09-09T17:37:44.834583Z","iopub.execute_input":"2023-09-09T17:37:44.835073Z","iopub.status.idle":"2023-09-09T17:37:44.842950Z","shell.execute_reply.started":"2023-09-09T17:37:44.835036Z","shell.execute_reply":"2023-09-09T17:37:44.841409Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# train_events = pd.read_csv('/kaggle/input/child-mind-institute-detect-sleep-states/train_events.csv')","metadata":{"id":"dTkGpIsPzT9z","execution":{"iopub.status.busy":"2023-09-09T15:09:56.767213Z","iopub.execute_input":"2023-09-09T15:09:56.767850Z","iopub.status.idle":"2023-09-09T15:09:56.812198Z","shell.execute_reply.started":"2023-09-09T15:09:56.767816Z","shell.execute_reply":"2023-09-09T15:09:56.811232Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# train_events","metadata":{"execution":{"iopub.status.busy":"2023-09-09T15:09:59.746485Z","iopub.execute_input":"2023-09-09T15:09:59.746878Z","iopub.status.idle":"2023-09-09T15:09:59.783394Z","shell.execute_reply.started":"2023-09-09T15:09:59.746845Z","shell.execute_reply":"2023-09-09T15:09:59.782450Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# train_series = pd.read_parquet('/kaggle/input/child-mind-institute-detect-sleep-states/train_series.parquet')\nzzs_series = pd.read_parquet('/kaggle/input/zzzs-lightweight-training-dataset-target/Zzzs_train.parquet')","metadata":{"id":"0GtyedIh09gc","execution":{"iopub.status.busy":"2023-09-09T17:37:54.320380Z","iopub.execute_input":"2023-09-09T17:37:54.320836Z","iopub.status.idle":"2023-09-09T17:38:06.596637Z","shell.execute_reply.started":"2023-09-09T17:37:54.320791Z","shell.execute_reply":"2023-09-09T17:38:06.595602Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# sample_submission = pd.read_csv('/kaggle/input/child-mind-institute-detect-sleep-states/sample_submission.csv')","metadata":{"id":"EUu1VIrE09jL","execution":{"iopub.status.busy":"2023-09-07T11:57:38.349265Z","iopub.execute_input":"2023-09-07T11:57:38.350109Z","iopub.status.idle":"2023-09-07T11:57:38.365917Z","shell.execute_reply.started":"2023-09-07T11:57:38.350057Z","shell.execute_reply":"2023-09-07T11:57:38.364569Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# test = zzs_series[zzs_series['series_id']== zzs_series['series_id'].unique()[0]]\n# test[zzs_series['awake']==0]","metadata":{"id":"Q3pSLFaC0uoY","outputId":"cf5ac45c-dab8-4ecb-e7f5-a50c5f948fa9","execution":{"iopub.status.busy":"2023-09-07T15:49:36.910377Z","iopub.execute_input":"2023-09-07T15:49:36.910799Z","iopub.status.idle":"2023-09-07T15:49:40.617610Z","shell.execute_reply.started":"2023-09-07T15:49:36.910767Z","shell.execute_reply":"2023-09-07T15:49:40.616343Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"zzs_series.dtypes","metadata":{"execution":{"iopub.status.busy":"2023-09-07T15:48:11.221464Z","iopub.execute_input":"2023-09-07T15:48:11.222087Z","iopub.status.idle":"2023-09-07T15:48:11.231204Z","shell.execute_reply.started":"2023-09-07T15:48:11.222046Z","shell.execute_reply":"2023-09-07T15:48:11.229964Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"zzs_series.describe()","metadata":{"id":"S1CO2u7Q0xCf","execution":{"iopub.status.busy":"2023-09-07T16:13:05.350495Z","iopub.execute_input":"2023-09-07T16:13:05.350977Z","iopub.status.idle":"2023-09-07T16:13:07.096415Z","shell.execute_reply.started":"2023-09-07T16:13:05.350937Z","shell.execute_reply":"2023-09-07T16:13:07.095279Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# New Data Processing","metadata":{}},{"cell_type":"code","source":"def feat_eng(df):\n \n    df['weekday'] = df['timestamp'].dt.weekday\n    df['is_weekend'] = np.where(df['weekday']>5, 1, 0)\n    df['month'] = df['timestamp'].dt.month\n    df['day'] = df['timestamp'].dt.day\n    \n     # parse the timestamp and create an \"hour\" feature\n    df[\"timestamp\"] = pd.to_datetime(df[\"timestamp\"],utc=True)\n    df[\"hour\"] = df[\"timestamp\"].dt.hour\n    # feature cross\n    df[\"anglez_times_enmo\"] = abs(df[\"anglez\"]) * df[\"enmo\"]\n    # \"rolling\" features\n    periods = 50\n    df[\"anglez_diff\"] = df.groupby('series_id')['anglez'].diff(periods=periods).fillna(method=\"bfill\")\n    df[\"enmo_diff\"]   = df.groupby('series_id')['enmo'].diff(periods=periods).fillna(method=\"bfill\")\n    df[\"anglez_rolling\"] = df[\"anglez\"].rolling(periods,center=True).mean().fillna(method=\"bfill\").fillna(method=\"ffill\")\n    df[\"enmo_rolling\"]   = df[\"enmo\"].rolling(periods,center=True).mean().fillna(method=\"bfill\").fillna(method=\"ffill\")\n#     df[\"anglez_diff_rolling\"] = df[\"anglez_diff\"].rolling(periods,center=True).mean().fillna(method=\"bfill\").fillna(method=\"ffill\")\n#     df[\"enmo_diff_rolling\"]   = df[\"enmo_diff\"].rolling(periods,center=True).mean().fillna(method=\"bfill\").fillna(method=\"ffill\")\n    \n    return df","metadata":{"execution":{"iopub.status.busy":"2023-09-09T17:38:06.598418Z","iopub.execute_input":"2023-09-09T17:38:06.598760Z","iopub.status.idle":"2023-09-09T17:38:06.605431Z","shell.execute_reply.started":"2023-09-09T17:38:06.598729Z","shell.execute_reply":"2023-09-09T17:38:06.604519Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"zzs_series['timestamp'] = pd.to_datetime(zzs_series['timestamp'],utc=True)\nzzs_series = feat_eng(zzs_series)","metadata":{"execution":{"iopub.status.busy":"2023-09-09T17:38:06.606712Z","iopub.execute_input":"2023-09-09T17:38:06.607580Z","iopub.status.idle":"2023-09-09T17:40:03.469982Z","shell.execute_reply.started":"2023-09-09T17:38:06.607544Z","shell.execute_reply":"2023-09-09T17:40:03.468633Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"zzs_series[zzs_series['series_id']=='d5e47b94477e']","metadata":{"execution":{"iopub.status.busy":"2023-09-09T16:39:14.054138Z","iopub.execute_input":"2023-09-09T16:39:14.054571Z","iopub.status.idle":"2023-09-09T16:39:16.576780Z","shell.execute_reply.started":"2023-09-09T16:39:14.054536Z","shell.execute_reply":"2023-09-09T16:39:16.575677Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# zzs_series['date'] =  pd.to_datetime(zzs_series[\"timestamp\"],utc=True)\n# zzs_series['hour'] = zzs_series['date'].dt.hour\n# zzs_series.head(10)","metadata":{"execution":{"iopub.status.busy":"2023-09-07T17:12:45.832543Z","iopub.execute_input":"2023-09-07T17:12:45.833162Z","iopub.status.idle":"2023-09-07T17:14:35.261704Z","shell.execute_reply.started":"2023-09-07T17:12:45.833111Z","shell.execute_reply":"2023-09-07T17:14:35.260407Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"zzs_series.iloc[0,6]","metadata":{"execution":{"iopub.status.busy":"2023-09-07T17:39:05.965291Z","iopub.execute_input":"2023-09-07T17:39:05.965789Z","iopub.status.idle":"2023-09-07T17:39:05.974251Z","shell.execute_reply.started":"2023-09-07T17:39:05.965753Z","shell.execute_reply":"2023-09-07T17:39:05.972886Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# missing_values = train_series.isnull().sum()\n\nzzs_series.dropna(subset=['timestamp'],inplace=True)\nzzs_series['step'].fillna(method='bfill',inplace=True)\n# zzs_series[].fillna(zzs_series.rolling(window=10).mean(), inplace=True)","metadata":{"id":"olx5yO-ZzUAu","execution":{"iopub.status.busy":"2023-09-09T17:40:03.476081Z","iopub.execute_input":"2023-09-09T17:40:03.476534Z","iopub.status.idle":"2023-09-09T17:40:05.477642Z","shell.execute_reply.started":"2023-09-09T17:40:03.476495Z","shell.execute_reply":"2023-09-09T17:40:05.476389Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# from sklearn.preprocessing import StandardScaler\n\n# scaler = StandardScaler()\n# zzs_series['enmo'] = scaler.fit_transform(zzs_series['enmo'].values.reshape(-1, 1))\n# zzs_series['anglez'] = scaler.fit_transform(zzs_series['anglez'].values.reshape(-1, 1))\n# zzs_series['hour'] = scaler.fit_transform(zzs_series['hour'].values.reshape(-1, 1))\n# zzs_series['is_weekend'] = scaler.fit_transform(zzs_series['is_weekend'].values.reshape(-1, 1))\n","metadata":{"id":"UfCSpQSAzUDx","execution":{"iopub.status.busy":"2023-09-09T17:40:05.479696Z","iopub.execute_input":"2023-09-09T17:40:05.480472Z","iopub.status.idle":"2023-09-09T17:40:06.386324Z","shell.execute_reply.started":"2023-09-09T17:40:05.480419Z","shell.execute_reply":"2023-09-09T17:40:06.385141Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# zzs_series['enmo'] = zzs_series['enmo'].rolling(window=10).mean()\n# zzs_series['anglez'] = zzs_series['anglez'].rolling(window=10).mean()\n# zzs_series['sleep_duration'] = (train_events['wakeup_timestamp'] - train_events['onset_timestamp']).dt.total_seconds()","metadata":{"id":"YPva59lMzUGp","execution":{"iopub.status.busy":"2023-09-09T15:14:01.398606Z","iopub.execute_input":"2023-09-09T15:14:01.399085Z","iopub.status.idle":"2023-09-09T15:14:02.337361Z","shell.execute_reply.started":"2023-09-09T15:14:01.399028Z","shell.execute_reply":"2023-09-09T15:14:02.336175Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Ran Until above cell**","metadata":{}},{"cell_type":"code","source":"# scaled[y_train == 0].plot.kde(ind=100, legend=False)\n# X_train_plt = zzs_series[[\"anglez\",\"enmo\"]]\n# y_train = zzs_series[\"awake\"]\n\n# X_train_plt[y_train==0].plot.kde(ind=3, legend=True)\n\n\n","metadata":{"execution":{"iopub.status.busy":"2023-09-07T17:47:46.685530Z","iopub.execute_input":"2023-09-07T17:47:46.685983Z","iopub.status.idle":"2023-09-07T17:47:48.508394Z","shell.execute_reply.started":"2023-09-07T17:47:46.685947Z","shell.execute_reply":"2023-09-07T17:47:48.507184Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# plt.imshow(X_train_plt.corr())\n# plt.colorbar()\n# plt.title('Correlation Matrix Plot of the Features');","metadata":{"execution":{"iopub.status.busy":"2023-09-07T17:50:44.811698Z","iopub.execute_input":"2023-09-07T17:50:44.812186Z","iopub.status.idle":"2023-09-07T17:50:45.642655Z","shell.execute_reply.started":"2023-09-07T17:50:44.812150Z","shell.execute_reply":"2023-09-07T17:50:45.641407Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"zzs_series['anglez'].fillna(zzs_series['anglez'].rolling(window=10).mean(),inplace=True)\nzzs_series.dropna(subset=['anglez'],inplace=True)","metadata":{"execution":{"iopub.status.busy":"2023-09-09T17:40:06.387812Z","iopub.execute_input":"2023-09-09T17:40:06.388297Z","iopub.status.idle":"2023-09-09T17:40:07.878963Z","shell.execute_reply.started":"2023-09-09T17:40:06.388252Z","shell.execute_reply":"2023-09-09T17:40:07.877740Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train = zzs_series[[\"anglez\",\"enmo\",'hour','is_weekend',\"anglez_times_enmo\",\"anglez_diff\",\"anglez_rolling\",\"enmo_diff\",\"enmo_rolling\"]]\ny_train = zzs_series[\"awake\"]\n","metadata":{"execution":{"iopub.status.busy":"2023-09-09T17:40:07.880554Z","iopub.execute_input":"2023-09-09T17:40:07.881047Z","iopub.status.idle":"2023-09-09T17:40:08.012424Z","shell.execute_reply.started":"2023-09-09T17:40:07.881004Z","shell.execute_reply":"2023-09-09T17:40:08.010472Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# X_train.isna().sum()","metadata":{"execution":{"iopub.status.busy":"2023-09-07T18:03:49.257830Z","iopub.execute_input":"2023-09-07T18:03:49.258208Z","iopub.status.idle":"2023-09-07T18:03:49.294503Z","shell.execute_reply.started":"2023-09-07T18:03:49.258178Z","shell.execute_reply":"2023-09-07T18:03:49.292651Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.pipeline import make_pipeline\nfrom sklearn.naive_bayes import GaussianNB\nimport lightgbm as lgb\nimport xgboost as xgb\nfrom sklearn.model_selection import GridSearchCV\n\n\n\n# model = GaussianNB()\nmodel = lgb.LGBMClassifier()\n# model = xgb.XGBClassifier(eval_metric = 'map',n_estimators = 100, max_depth = 3, learning_rate = 0.01,scale_pos_weight = 2/3)\n# param_grid = {\n#     'n_estimators': [100, 200, 300],\n#     'max_depth': [3, 4, 5],\n#     'learning_rate': [0.01, 0.1, 0.2],\n#     'scale_pos_weight': [2/3]\n# }\n\n# grid_search = GridSearchCV(estimator=model, param_grid = param_grid, cv=5)\n# grid_search.fit(X_train, y_train)\n# best_params = grid_search.best_params\n\n# model = xgb.XGBClassifier(**best_params)\n\nmodel.fit(X_train, y_train)\n\n","metadata":{"execution":{"iopub.status.busy":"2023-09-09T19:00:01.928331Z","iopub.execute_input":"2023-09-09T19:00:01.928744Z","iopub.status.idle":"2023-09-09T19:10:15.356892Z","shell.execute_reply.started":"2023-09-09T19:00:01.928711Z","shell.execute_reply":"2023-09-09T19:10:15.355233Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Test data Processing ","metadata":{}},{"cell_type":"code","source":"test  = pd.read_parquet(\"/kaggle/input/child-mind-institute-detect-sleep-states/test_series.parquet\")\n","metadata":{"execution":{"iopub.status.busy":"2023-09-09T19:10:15.359184Z","iopub.execute_input":"2023-09-09T19:10:15.359576Z","iopub.status.idle":"2023-09-09T19:10:15.400705Z","shell.execute_reply.started":"2023-09-09T19:10:15.359542Z","shell.execute_reply":"2023-09-09T19:10:15.399331Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test['timestamp'] =  pd.to_datetime(test[\"timestamp\"],utc=True)\ntest = feat_eng(test)\n\ntest.dropna(subset=['timestamp'],inplace=True)\ntest['step'].fillna(method='bfill',inplace=True)\n\n# test['enmo'] = scaler.fit_transform(test['enmo'].values.reshape(-1, 1))\n# test['anglez'] = scaler.fit_transform(test['anglez'].values.reshape(-1, 1))\n# test['hour'] = scaler.fit_transform(test['hour'].values.reshape(-1, 1))\n# test['is_weekend'] = scaler.fit_transform(test['is_weekend'].values.reshape(-1, 1))\n\n# test['enmo'] = test['enmo'].rolling(window=10).mean()\n# test['anglez'] = test['anglez'].rolling(window=10).mean()\n\ntest['anglez'].fillna(test['anglez'].rolling(window=10).mean(),inplace=True)\ntest.dropna(subset=['anglez'],inplace=True)\n\nX_test = test[[\"anglez\",\"enmo\",'hour','is_weekend',\"anglez_times_enmo\",\"anglez_diff\",\"anglez_rolling\",\"enmo_diff\",\"enmo_rolling\"]]\n","metadata":{"execution":{"iopub.status.busy":"2023-09-09T19:10:15.402176Z","iopub.execute_input":"2023-09-09T19:10:15.402552Z","iopub.status.idle":"2023-09-09T19:10:15.463225Z","shell.execute_reply.started":"2023-09-09T19:10:15.402519Z","shell.execute_reply":"2023-09-09T19:10:15.461938Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_test","metadata":{"execution":{"iopub.status.busy":"2023-09-09T15:36:30.926581Z","iopub.execute_input":"2023-09-09T15:36:30.926930Z","iopub.status.idle":"2023-09-09T15:36:30.946424Z","shell.execute_reply.started":"2023-09-09T15:36:30.926898Z","shell.execute_reply":"2023-09-09T15:36:30.945149Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test['awake'] = model.predict(X_test) ","metadata":{"execution":{"iopub.status.busy":"2023-09-09T19:10:15.467670Z","iopub.execute_input":"2023-09-09T19:10:15.468306Z","iopub.status.idle":"2023-09-09T19:10:15.481329Z","shell.execute_reply.started":"2023-09-09T19:10:15.468246Z","shell.execute_reply":"2023-09-09T19:10:15.479196Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test[test['awake']==0]","metadata":{"execution":{"iopub.status.busy":"2023-09-09T18:57:09.683820Z","iopub.status.idle":"2023-09-09T18:57:09.684475Z","shell.execute_reply.started":"2023-09-09T18:57:09.684138Z","shell.execute_reply":"2023-09-09T18:57:09.684172Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"proba = model.predict_proba(X_test)","metadata":{"execution":{"iopub.status.busy":"2023-09-09T19:10:15.483677Z","iopub.execute_input":"2023-09-09T19:10:15.484183Z","iopub.status.idle":"2023-09-09T19:10:15.494934Z","shell.execute_reply.started":"2023-09-09T19:10:15.484132Z","shell.execute_reply":"2023-09-09T19:10:15.492766Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test['score'] = proba[:,1]","metadata":{"execution":{"iopub.status.busy":"2023-09-09T19:10:15.496904Z","iopub.execute_input":"2023-09-09T19:10:15.497543Z","iopub.status.idle":"2023-09-09T19:10:15.508911Z","shell.execute_reply.started":"2023-09-09T19:10:15.497481Z","shell.execute_reply":"2023-09-09T19:10:15.507869Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from itertools import groupby\n\ntest[\"not_awake\"] = 1-test[\"awake\"]\n# exponential smoothing of the predictions\ntest[\"smooth\"] = test[\"not_awake\"].ewm(span = 100).mean()\n# re-binarize\ntest[\"smooth\"] = test[\"smooth\"].round()\n\n# https://stackoverflow.com/questions/73777727/how-to-mark-start-end-of-a-series-of-non-null-and-non-0-values-in-a-column-of-a\ndef get_event(df):\n    lstCV = zip(df.series_id, df.smooth)\n    lstPOI = []\n    for (c, v), g in groupby(lstCV, lambda cv: \n                            (cv[0], cv[1]!=0 and not pd.isnull(cv[1]))):\n        llg = sum(1 for item in g)\n        if v is False: \n            lstPOI.extend([0]*llg)\n        else: \n            lstPOI.extend(['onset']+(llg-2)*[0]+['wakeup'] if llg > 1 else [0])\n    return lstPOI\n\ntest[\"event\"] = get_event(test)","metadata":{"execution":{"iopub.status.busy":"2023-09-09T19:10:15.510463Z","iopub.execute_input":"2023-09-09T19:10:15.511713Z","iopub.status.idle":"2023-09-09T19:10:15.532073Z","shell.execute_reply.started":"2023-09-09T19:10:15.511666Z","shell.execute_reply":"2023-09-09T19:10:15.530635Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission = test.loc[test[\"event\"] != 0][[\"series_id\",\"step\",\"event\",\"score\"]].copy().reset_index(drop=True).reset_index(names=\"row_id\")","metadata":{"execution":{"iopub.status.busy":"2023-09-09T19:10:15.533507Z","iopub.execute_input":"2023-09-09T19:10:15.533927Z","iopub.status.idle":"2023-09-09T19:10:15.558650Z","shell.execute_reply.started":"2023-09-09T19:10:15.533889Z","shell.execute_reply":"2023-09-09T19:10:15.557562Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission.to_csv('submission.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2023-09-09T19:10:15.560056Z","iopub.execute_input":"2023-09-09T19:10:15.560993Z","iopub.status.idle":"2023-09-09T19:10:15.578364Z","shell.execute_reply.started":"2023-09-09T19:10:15.560951Z","shell.execute_reply":"2023-09-09T19:10:15.577194Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission","metadata":{"execution":{"iopub.status.busy":"2023-09-09T19:10:15.581277Z","iopub.execute_input":"2023-09-09T19:10:15.582237Z","iopub.status.idle":"2023-09-09T19:10:15.603433Z","shell.execute_reply.started":"2023-09-09T19:10:15.582190Z","shell.execute_reply":"2023-09-09T19:10:15.602325Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Author Previous Code**","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"}}