convert this ipynb into python
```
{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "58c0f3c4",
   "metadata": {
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "# Using XGBoost to forecast Etr (i.e. energy delivered) for Ocado fleet\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "0843d4f9",
   "metadata": {},
   "source": [
    "## Verify jupyter is running in venv\n",
    "\n",
    "Skip if you do not want this check\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "203e0084",
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "print(\"Virtual environments:\")\n",
    "print(sys.prefix)\n",
    "print()\n",
    "!{sys.executable} -m jupyter kernelspec list\n",
    "print()\n",
    "if hasattr(sys, \"real_prefix\") or (\n",
    "    hasattr(sys, \"base_prefix\") and sys.base_prefix != sys.prefix\n",
    "):\n",
    "    print(\"Inside Virtualenv\")\n",
    "else:\n",
    "    print(\"Not in Virtualenv\")\n",
    "    !bash init.sh\n",
    "    import IPython\n",
    "    app = IPython.Application.instance()\n",
    "    print(\"Kernel will be shutdown now. Pleases restart the kernel using the new virtualenv.\")\n",
    "    app.kernel.do_shutdown(True)\n",
    "    sys.exit(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2c91c9ea",
   "metadata": {},
   "outputs": [],
   "source": [
    "%%capture --no-stdout\n",
    "print(\"Double check requirements are installed\")\n",
    "%pip install -r requirements.pip.txt"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "ef671809",
   "metadata": {
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "## Steps:\n",
    "\n",
    "1. Write function for feature creation\n",
    "2. Write function for lag features\n",
    "3. Basic train test data split\n",
    "4. Visualise data split\n",
    "5. Time series cross validation\n",
    "6. Build model\n",
    "7. Cross validation evaluation\n",
    "8. Show feature importance\n",
    "9. Check worst predicted days\n",
    "10. Generate forecast\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a2f7e6d8",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "import holidays\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "\n",
    "# import\n",
    "import pandas as 