diff --git a/src/data-processing.ipynb b/src/data-processing.ipynb index 7ca4223..ee578a2 100644 --- a/src/data-processing.ipynb +++ b/src/data-processing.ipynb @@ -69,7 +69,7 @@ " \"PRODUCT_COMBINATION\", \"DAYS_FIRST_DRAWING\", \"DAYS_FIRST_DUE\", \"DAYS_LAST_DUE_1ST_VERSION\", \"DAYS_LAST_DUE\", \"DAYS_TERMINATION\"], inplace=True)\n", "prev = prev[prev[\"NAME_CONTRACT_STATUS\"] != \"Canceled\"]\n", "prev.fillna(0, inplace=True)\n", - "prev[\"TIME_TO_PAY\"] = prev[\"AMT_CREDIT\"] / prev[\"AMT_ANNUITY\"]\n", + "prev[\"TIME_TO_PAY\"] = np.where(prev[\"AMT_ANNUITY\"] == 0, 0, prev[\"AMT_CREDIT\"] / prev[\"AMT_ANNUITY\"])\n", "prev[\"AMT_CREDIT\"] = np.where(prev[\"NAME_CONTRACT_STATUS\"] == \"Refused\", 0, prev[\"AMT_CREDIT\"])\n", "prev[\"CREDIT_DIFFERENCE\"] = prev[\"AMT_CREDIT\"] - prev[\"AMT_APPLICATION\"]\n", "prev.drop(columns=[\"AMT_ANNUITY\", \"AMT_APPLICATION\", \"AMT_CREDIT\"], inplace=True)\n",