{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "37ac6be2-a15f-40db-ba98-7f4559cf5749",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "df = pd.read_pickle('../echo-dot-activity.pickel')\n",
    "\n",
    "print(\"ip/ip.dst\" in df.columns)\n",
    "\n",
    "df['Activity'] = pd.Series(False, index=df.index)\n",
    "\n",
    "df.loc[2330 - 12198, 'Activity'] = True  # music listening\n",
    "df.loc[12744 - 13396, 'Activity'] = True  # announcement\n",
    "df.loc[13548 - 20533, 'Activity'] = True  # key exchange? maybe not activity...\n",
    "df.loc[20556 - 26757, 'Activity'] = True  # music listening\n",
    "df.loc[26813 - 26825, 'Activity'] = True  # announcement\n",
    "df.loc[26918 - 26936, 'Activity'] = True  # volume adjustement \n",
    "\n",
    "df.to_pickle('../echo-dot-activity.pickel')\n"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "fe1e40dd56e78b5"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "df = pd.read_pickle(\"../echo-dot-attack.pickel\")\n",
    "\n",
    "df[\"Attack\"] = pd.Series(False, index=df.index, dtype=int)\n",
    "\n",
    "print(\"ip/ip.dst\" in df.columns)\n",
    "\n",
    "df.loc[49 - 262255, \"Attack\"] = 2\n",
    "df.loc[262258 - 622810, \"Attack\"] = 2\n",
    "df.loc[624338 - 624363, \"Attack\"] = 1\n",
    "df.loc[624541 - 627011, \"Attack\"] = 3\n",
    "\n",
    "df.to_pickle(\"../echo-dot-attack.pickel\")"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "d6a43f9140b4e1f9"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
