From 86f4af3da156295d2a876f63b0689447ad4ccbe2 Mon Sep 17 00:00:00 2001 From: Jai Date: Wed, 31 Jan 2024 12:32:51 +0000 Subject: [PATCH 01/14] Added social02 schema --- aeon/schema/schemas.py | 54 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/aeon/schema/schemas.py b/aeon/schema/schemas.py index 0afd2472..d2647a1a 100644 --- a/aeon/schema/schemas.py +++ b/aeon/schema/schemas.py @@ -82,5 +82,57 @@ ] ) +social01 = DotMap( + [ + Device("Metadata", core.metadata), + Device("Environment", social.environment_b, social.subject_b), + Device("CameraTop", core.video, social.camera_top_pos_b), + Device("CameraNorth", core.video), + Device("CameraSouth", core.video), + Device("CameraEast", core.video), + Device("CameraWest", core.video), + Device("CameraPatch1", core.video), + Device("CameraPatch2", core.video), + Device("CameraPatch3", core.video), + Device("CameraNest", core.video), + Device("Nest", social.weight_raw_b, social.weight_filtered_b), + Device("Patch1", social.patch_streams_b), + Device("Patch2", social.patch_streams_b), + Device("Patch3", social.patch_streams_b), + Device("RfidGate", social.rfid_events_b), + Device("RfidNest1", social.rfid_events_b), + Device("RfidNest2", social.rfid_events_b), + Device("RfidPatch1", social.rfid_events_b), + Device("RfidPatch2", social.rfid_events_b), + Device("RfidPatch3", social.rfid_events_b), + ] +) + +social02 = DotMap( + [ + Device("Metadata", core.metadata), + Device("Environment", social.environment_b, social.subject_b), + Device("CameraTop", core.video, social.camera_top_pos_b), + Device("CameraNorth", core.video), + Device("CameraSouth", core.video), + Device("CameraEast", core.video), + Device("CameraWest", core.video), + Device("CameraPatch1", core.video), + Device("CameraPatch2", core.video), + Device("CameraPatch3", core.video), + Device("CameraNest", core.video), + Device("Nest", social.weight_raw_b, social.weight_filtered_b), + Device("Patch1", social.patch_streams_b), + Device("Patch2", social.patch_streams_b), + Device("Patch3", social.patch_streams_b), + Device("Patch1Rfid", social.rfid_events_b), + Device("Patch2Rfid", social.rfid_events_b), + Device("Patch3Rfid", social.rfid_events_b), + Device("NestRfid1", social.rfid_events_b), + Device("NestRfid2", social.rfid_events_b), + Device("GateRfid", social.rfid_events_b), + ] +) + -__all__ = ["exp01", "exp02", "octagon01", "social01"] +__all__ = ["exp01", "exp02", "octagon01", "social01", "social02"] From ed4cec5dd93563ece38e6969a3754858cb5d0857 Mon Sep 17 00:00:00 2001 From: Jai Date: Thu, 1 Feb 2024 13:09:02 +0000 Subject: [PATCH 02/14] updated social02 schema --- aeon/schema/schemas.py | 26 -------------------------- aeon/schema/social.py | 5 +---- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/aeon/schema/schemas.py b/aeon/schema/schemas.py index d2647a1a..4f95bf91 100644 --- a/aeon/schema/schemas.py +++ b/aeon/schema/schemas.py @@ -82,32 +82,6 @@ ] ) -social01 = DotMap( - [ - Device("Metadata", core.metadata), - Device("Environment", social.environment_b, social.subject_b), - Device("CameraTop", core.video, social.camera_top_pos_b), - Device("CameraNorth", core.video), - Device("CameraSouth", core.video), - Device("CameraEast", core.video), - Device("CameraWest", core.video), - Device("CameraPatch1", core.video), - Device("CameraPatch2", core.video), - Device("CameraPatch3", core.video), - Device("CameraNest", core.video), - Device("Nest", social.weight_raw_b, social.weight_filtered_b), - Device("Patch1", social.patch_streams_b), - Device("Patch2", social.patch_streams_b), - Device("Patch3", social.patch_streams_b), - Device("RfidGate", social.rfid_events_b), - Device("RfidNest1", social.rfid_events_b), - Device("RfidNest2", social.rfid_events_b), - Device("RfidPatch1", social.rfid_events_b), - Device("RfidPatch2", social.rfid_events_b), - Device("RfidPatch3", social.rfid_events_b), - ] -) - social02 = DotMap( [ Device("Metadata", core.metadata), diff --git a/aeon/schema/social.py b/aeon/schema/social.py index f9e7691d..fb56f4c9 100644 --- a/aeon/schema/social.py +++ b/aeon/schema/social.py @@ -102,7 +102,4 @@ def rfid_events_b(pattern): """RFID events reader""" - pattern = pattern.replace("Rfid", "") - if pattern.startswith("Events"): - pattern = pattern.replace("Events", "") - return {"RfidEvents": reader.Harp(f"RfidEvents{pattern}_*", ["rfid"])} + return {pattern: reader.Harp(f"{pattern}_8*", ["rfid"])} From 69da6be8951cd1e2b43340380578fee572df56b7 Mon Sep 17 00:00:00 2001 From: Jai Date: Thu, 1 Feb 2024 13:09:29 +0000 Subject: [PATCH 03/14] updated register for rfid binder function --- aeon/schema/social.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aeon/schema/social.py b/aeon/schema/social.py index fb56f4c9..fb07653d 100644 --- a/aeon/schema/social.py +++ b/aeon/schema/social.py @@ -102,4 +102,4 @@ def rfid_events_b(pattern): """RFID events reader""" - return {pattern: reader.Harp(f"{pattern}_8*", ["rfid"])} + return {pattern: reader.Harp(f"{pattern}_32*", ["rfid"])} From 77f53b2a6a5412918839a3d8277b985cf651f78b Mon Sep 17 00:00:00 2001 From: Jai Date: Thu, 1 Feb 2024 13:10:10 +0000 Subject: [PATCH 04/14] fixed whitespace --- aeon/schema/social.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aeon/schema/social.py b/aeon/schema/social.py index fb07653d..89c180d0 100644 --- a/aeon/schema/social.py +++ b/aeon/schema/social.py @@ -99,7 +99,6 @@ # Rfid # --- - def rfid_events_b(pattern): """RFID events reader""" return {pattern: reader.Harp(f"{pattern}_32*", ["rfid"])} From ae31d967c81568bad82397d09ac6f77aa59e987d Mon Sep 17 00:00:00 2001 From: Jai Date: Thu, 1 Feb 2024 16:20:47 +0000 Subject: [PATCH 05/14] change rfidevents dotmap name --- aeon/schema/social.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aeon/schema/social.py b/aeon/schema/social.py index 89c180d0..d9113d4e 100644 --- a/aeon/schema/social.py +++ b/aeon/schema/social.py @@ -101,4 +101,4 @@ def rfid_events_b(pattern): """RFID events reader""" - return {pattern: reader.Harp(f"{pattern}_32*", ["rfid"])} + return {"RfidEvents": reader.Harp(f"{pattern}_32*", ["rfid"])} From b99f658634bcf9f8078302ee1c6321515c2b4e9a Mon Sep 17 00:00:00 2001 From: Jai Date: Tue, 6 Feb 2024 11:25:34 +0000 Subject: [PATCH 06/14] fixed bug in SubjectVisits stream for social02 schema --- aeon/schema/social.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aeon/schema/social.py b/aeon/schema/social.py index d9113d4e..1afbff6d 100644 --- a/aeon/schema/social.py +++ b/aeon/schema/social.py @@ -50,7 +50,7 @@ # SubjectVisits subject_visits_b = lambda pattern: { - "SubjectVisits": reader.Csv(f"{pattern}_SubjectVisit_*", ["id", "type", "region"]) + "SubjectVisits": reader.Csv(f"{pattern}_SubjectVisits_*", ["id", "type", "region"]) } # SubjectWeight From 8071a4058c0aa826c6a4eb8c13302d458b90d639 Mon Sep 17 00:00:00 2001 From: Jai Date: Tue, 6 Feb 2024 16:41:22 +0000 Subject: [PATCH 07/14] fixes #327 --- aeon/io/api.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/aeon/io/api.py b/aeon/io/api.py index 5c16159f..e0fafb89 100644 --- a/aeon/io/api.py +++ b/aeon/io/api.py @@ -2,7 +2,9 @@ import datetime from os import PathLike from pathlib import Path +import warnings +import numpy as np import pandas as pd """The duration of each acquisition chunk, in whole hours.""" @@ -138,15 +140,11 @@ def load(root, reader, start=None, end=None, time=None, tolerance=None, epoch=No _set_index(data) if start is not None or end is not None: try: - return data.loc[start:end] + start_idx, end_idx = np.where(data.index >= start)[0][0], np.where(data.index <= end)[0][-1] + return data.iloc[start_idx:end_idx] except KeyError: - import warnings - if not data.index.has_duplicates: warnings.warn(f"data index for {reader.pattern} contains out-of-order timestamps!") data = data.sort_index() - else: - warnings.warn(f"data index for {reader.pattern} contains duplicate keys!") - data = data[~data.index.duplicated(keep="first")] - return data.loc[start:end] + return data.iloc[start_idx:end_idx] return data From ea7ed6f375b011b3e179a684d5fed4e819d7ff61 Mon Sep 17 00:00:00 2001 From: Jai Date: Wed, 14 Feb 2024 13:38:06 +0000 Subject: [PATCH 08/14] wrangled per-subject data --- social01_block_analysis.ipynb | 5778 +++++++++++++++++++++++++++++++++ 1 file changed, 5778 insertions(+) create mode 100644 social01_block_analysis.ipynb diff --git a/social01_block_analysis.ipynb b/social01_block_analysis.ipynb new file mode 100644 index 00000000..0e56d515 --- /dev/null +++ b/social01_block_analysis.ipynb @@ -0,0 +1,5778 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "%load_ext autoreload\n", + "%autoreload 2\n", + "# %flow mode reactive\n", + "\n", + "from importlib import reload\n", + "from pathlib import Path\n", + "\n", + "from dotmap import DotMap\n", + "import numpy as np\n", + "import pandas as pd\n", + "import plotly.express as px\n", + "import plotly.graph_objs as go\n", + "import seaborn as sns\n", + "\n", + "import aeon\n", + "from aeon.analysis.utils import visits, distancetravelled\n", + "from aeon.io import reader\n", + "from aeon.io.device import Device, register\n", + "from aeon.schema import core, foraging, social\n", + "from aeon.schema.schemas import exp02, social01, social02\n", + "import datajoint as dj" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "# Prettify pandas output display.\n", + "\n", + "pd.set_option(\"display.max_columns\", 20)\n", + "pd.set_option(\"display.max_rows\", 50)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%% md\n" + } + }, + "source": [ + "## Create VirtualModule to access `aeon_test_analysis` schema\n", + "Currently, the analysis is on `aeon_test_`, will move to `aeon_` soon (once ready for production)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [], + "source": [ + "analysis_vm = dj.create_virtual_module('aeon_test_analysis', 'aeon_test_analysis')" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%% md\n" + } + }, + "source": [ + "## Browse Block and BlockAnalysis" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# View ERD around analysis\n", + "\n", + "dj.Diagram(analysis_vm) - 1" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [], + "source": [ + "# View Block table\n", + "\n", + "analysis_vm.Block()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Fetch BlockAnalysis table\n", + "\n", + "blocks = analysis_vm.BlockAnalysis().fetch(format=\"frame\")\n", + "blocks" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [], + "source": [ + "# Spec block(s) of interest\n", + "\n", + "# block_key = {\n", + "# \"experiment_name\": \"social0.1-aeon3\",\n", + "# \"block_start\": \"2023-12-05 11:06:01.001984\",\n", + "# } \n", + "block_start = \"block_start LIKE '2023-12-03%'\"\n", + "experiment_name = \"experiment_name LIKE 'social0.1-aeon3'\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [], + "source": [ + "# Given above keys, restrict BlockAnalysis table, and select info of first of returned blocks\n", + "\n", + "block_df = (analysis_vm.BlockAnalysis & block_start & experiment_name).fetch(format=\"frame\")\n", + "display(block_df)\n", + "block_key = {\n", + " \"experiment_name\": block_df.index[0][0],\n", + " \"block_start\": block_df.index[0][1]\n", + "}\n", + "print(block_key)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Return BlockAnalysis' part tables\n", + "\n", + "analysis_vm.BlockAnalysis.parts()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [], + "source": [ + "# For each part table, display and fetch info for the block of interest\n", + "\n", + "display(analysis_vm.BlockAnalysis.Patch & block_key)\n", + "display(analysis_vm.BlockAnalysis.Subject & block_key)\n", + "block_patch_data = (analysis_vm.BlockAnalysis.Patch & block_key).fetch(as_dict=True)\n", + "block_subject_data = (analysis_vm.BlockAnalysis.Subject & block_key).fetch(as_dict=True)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Corral some data" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\732382373.py:39: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " if block_info.pellet_ct[i - 1] > 0:\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\732382373.py:41: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " elif block_info.pellet_ct[i - 1] == 0 and block_info.index[i] - block_info.index[i - 1] > pd.Timedelta(\"1s\"):\n", + "c:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:139: FutureWarning: The behavior of array concatenation with empty entries is deprecated. In a future version, this will no longer exclude empty items when determining the result dtype. To retain the old behavior, exclude the empty entries before the concat operation.\n", + " data = pd.concat([reader.read(file) for _, file in files])\n", + "c:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:139: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " data = pd.concat([reader.read(file) for _, file in files])\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\732382373.py:39: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " if block_info.pellet_ct[i - 1] > 0:\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\732382373.py:41: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " elif block_info.pellet_ct[i - 1] == 0 and block_info.index[i] - block_info.index[i - 1] > pd.Timedelta(\"1s\"):\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
rootsleap_model_dirstartendblock_durationsubjectspatch_infopellet_infocum_wheel_dist
0Z:\\aeon\\data\\raw\\AEON4\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...2024-01-31 12:59:06.0059838292024-01-31 14:58:11.045983791NoneNoneNoneNoneNone
1Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-01-31 12:59:14.0019841192024-01-31 14:45:59.000000000NoneNoneNoneNoneNone
2Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-01-31 14:45:55.0000000002024-01-31 16:18:11.001984119NoneNoneNoneNoneNone
3Z:\\aeon\\data\\raw\\AEON4\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...2024-01-31 14:58:07.0459837912024-01-31 17:49:26.000000000NoneNoneNoneNoneNone
4Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-01-31 16:18:07.0019841192024-01-31 17:56:23.000000000NoneNoneNoneNoneNone
..............................
269Z:\\aeon\\data\\raw\\AEON4\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...2024-02-13 11:46:05.0000000002024-02-13 13:02:51.049983978NoneNoneNoneNoneNone
270Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-02-13 12:40:27.0000000002024-02-13 15:17:20.001984119NoneNoneNoneNoneNone
271Z:\\aeon\\data\\raw\\AEON4\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...2024-02-13 13:02:47.0499839782024-02-13 15:32:22.001984119NoneNoneNoneNoneNone
272Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-02-13 15:17:16.0019841192024-02-13 18:03:15.001984119NoneNoneNoneNoneNone
273Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-02-13 18:03:11.0019841192024-02-13 20:29:47.021984100NoneNoneNoneNoneNone
\n", + "

274 rows × 9 columns

\n", + "
" + ], + "text/plain": [ + " root \\\n", + "0 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", + "1 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", + "2 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", + "3 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", + "4 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", + ".. ... \n", + "269 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", + "270 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", + "271 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", + "272 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", + "273 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", + "\n", + " sleap_model_dir \\\n", + "0 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", + "1 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", + "2 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", + "3 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", + "4 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", + ".. ... \n", + "269 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", + "270 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", + "271 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", + "272 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", + "273 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", + "\n", + " start end \\\n", + "0 2024-01-31 12:59:06.005983829 2024-01-31 14:58:11.045983791 \n", + "1 2024-01-31 12:59:14.001984119 2024-01-31 14:45:59.000000000 \n", + "2 2024-01-31 14:45:55.000000000 2024-01-31 16:18:11.001984119 \n", + "3 2024-01-31 14:58:07.045983791 2024-01-31 17:49:26.000000000 \n", + "4 2024-01-31 16:18:07.001984119 2024-01-31 17:56:23.000000000 \n", + ".. ... ... \n", + "269 2024-02-13 11:46:05.000000000 2024-02-13 13:02:51.049983978 \n", + "270 2024-02-13 12:40:27.000000000 2024-02-13 15:17:20.001984119 \n", + "271 2024-02-13 13:02:47.049983978 2024-02-13 15:32:22.001984119 \n", + "272 2024-02-13 15:17:16.001984119 2024-02-13 18:03:15.001984119 \n", + "273 2024-02-13 18:03:11.001984119 2024-02-13 20:29:47.021984100 \n", + "\n", + " block_duration subjects patch_info pellet_info cum_wheel_dist \n", + "0 None None None None None \n", + "1 None None None None None \n", + "2 None None None None None \n", + "3 None None None None None \n", + "4 None None None None None \n", + ".. ... ... ... ... ... \n", + "269 None None None None None \n", + "270 None None None None None \n", + "271 None None None None None \n", + "272 None None None None None \n", + "273 None None None None None \n", + "\n", + "[274 rows x 9 columns]" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "\"\"\"Create a blocks df.\"\"\"\n", + "\n", + "exp_start = pd.Timestamp(\"2024-01-31 00:00:00\")\n", + "exp_end = pd.Timestamp(\"2024-02-17 00:00:00\")\n", + "# roots = [\n", + "# Path(\"/ceph/aeon/aeon/data/raw/AEON3/social0.2\"),\n", + "# Path(\"/ceph/aeon/aeon/data/raw/AEON4/social0.2\"),\n", + "# ]\n", + "roots = [\n", + " Path(r\"Z:\\aeon\\data\\raw\\AEON3\\social0.2\"),\n", + " Path(r\"Z:\\aeon\\data\\raw\\AEON4\\social0.2\"),\n", + "]\n", + "social02.CameraTop.Pose._model_root = Path(r\"Z:\\aeon\\data\\processed\")\n", + "arenas = [\"AEON3\", \"AEON4\"]\n", + "patches = [\"Patch1\", \"Patch2\", \"Patch3\"]\n", + "patch_locs = pd.DataFrame(index=arenas, columns=patches)\n", + "blocks_df = pd.DataFrame()\n", + "block_ts_tol = pd.Timedelta(\"2s\") # Tolerance for block start and end times\n", + "good_block_pel_ct = 4 # Min pellets for good block\n", + "\n", + "\n", + "for root in roots:\n", + " # Pull out info from metadata\n", + " for arena in arenas:\n", + " if arena in str(root):\n", + " break\n", + " metadata = aeon.load(root, social02.Metadata, exp_start, exp_end).iloc[0].metadata\n", + " patch_locs.loc[arena, patches] = (\n", + " (metadata.Devices.Patch1Rfid.Location.X, metadata.Devices.Patch1Rfid.Location.Y),\n", + " (metadata.Devices.Patch2Rfid.Location.X, metadata.Devices.Patch2Rfid.Location.Y),\n", + " (metadata.Devices.Patch3Rfid.Location.X, metadata.Devices.Patch3Rfid.Location.Y)\n", + " )\n", + " block_info = aeon.load(root, social02.Environment.BlockState, exp_start, exp_end)\n", + "\n", + " # Block end if pellet_ct == 0 and preceding pellet_ct > 0\n", + " # OR pellet_ct == 0, preceding pellet_ct == 0, and preceding pellet_ct time diff > 1s\n", + " possible_block_end_indxs = np.where(block_info.pellet_ct == 0)[0]\n", + " drop_indxs = []\n", + "\n", + " for i in possible_block_end_indxs:\n", + " if block_info.pellet_ct[i - 1] > 0:\n", + " continue\n", + " elif block_info.pellet_ct[i - 1] == 0 and block_info.index[i] - block_info.index[i - 1] > pd.Timedelta(\"1s\"):\n", + " continue\n", + " else: # drop i from `possible_block_ends`\n", + " drop_indxs.append(i)\n", + "\n", + " block_end_indxs = np.setdiff1d(possible_block_end_indxs, drop_indxs)\n", + " # Start from first complete block to last complete block\n", + " block_start_indxs = block_end_indxs[0:-1] \n", + " block_end_indxs = block_end_indxs[1:]\n", + " block_start_times = block_info.index[block_start_indxs] - block_ts_tol\n", + " block_end_times = block_info.index[block_end_indxs] + block_ts_tol\n", + " sleap_model_dir = (\n", + " Path(r\"Z:/aeon/data/processed/test-node1/4310907/2024-01-12T19-00-00/topdown-multianimal-id-133\")\n", + " if \"AEON3\" in str(root) else \n", + " Path(r\"Z:/aeon/data/processed/test-node1/4350621/2024-01-22T19-00-00/topdown-multianimal-id-133\")\n", + " )\n", + "\n", + " # Create a `blocks` df with columns 'start', 'end', and 'root'\n", + " blocks_df = pd.concat(\n", + " [\n", + " blocks_df,\n", + " pd.DataFrame(\n", + " { \n", + " \"root\": [root] * len(block_start_times),\n", + " \"sleap_model_dir\": [sleap_model_dir] * len(block_start_times),\n", + " \"start\": block_start_times, \n", + " \"end\": block_end_times, \n", + " }\n", + " )\n", + " ], ignore_index=True\n", + " )\n", + "\n", + "# Add columns to `blocks_df`\n", + "new_cols = [\n", + " \"block_duration\",\n", + " \"subjects\", # list of subjects in block\n", + " \"patch_info\", # df: index: patch; cols: rate, offset\n", + " \"pellet_info\", # df: index: del ts; cols: patch, thresh, id {for each pel del, get last thresh}\n", + " \"cum_wheel_dist\", # DotMap: patch: df\n", + "]\n", + "for col in new_cols:\n", + " blocks_df[col] = None\n", + "\n", + "blocks_df = blocks_df.sort_values(by=\"start\").reset_index(drop=True)\n", + "display(blocks_df)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "c:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:139: FutureWarning: The behavior of array concatenation with empty entries is deprecated. In a future version, this will no longer exclude empty items when determining the result dtype. To retain the old behavior, exclude the empty entries before the concat operation.\n", + " data = pd.concat([reader.read(file) for _, file in files])\n" + ] + } + ], + "source": [ + "\"\"\"Get subject env visits.\"\"\"\n", + "\n", + "subject_env_visits = {}\n", + "\n", + "for root, arena in zip(roots, arenas):\n", + " subject_visits = aeon.load(root, social02.Environment.SubjectVisits, exp_start, exp_end)\n", + " # Find all rows where:\n", + " # - 'id' column starts with \"*AA\"\n", + " # - 'type' column is either \"Enter\" or \"Exit\" or \"Remain\",\n", + " # - 'region' column is \"Environment\"\n", + " subject_visits = subject_visits[\n", + " (subject_visits.id.str.contains(\"^.*AA\"))\n", + " & (subject_visits.type.isin([\"Enter\", \"Exit\", \"Remain\"]))\n", + " & (subject_visits.region == \"Environment\")\n", + " ]\n", + " subject_env_visits[arena] = subject_visits" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'AEON3': id type region\n", + " time \n", + " 2024-01-31 11:28:45.543519974 BAA-1104045 Remain Environment\n", + " 2024-02-01 22:36:53.196512222 BAA-1104045 Remain Environment\n", + " 2024-02-02 00:15:06.000000000 BAA-1104045 Remain Environment\n", + " 2024-02-03 16:28:29.139999866 BAA-1104045 Exit Environment\n", + " 2024-02-05 15:43:11.581535816 BAA-1104047 Remain Environment\n", + " 2024-02-08 14:49:41.552000046 BAA-1104047 Exit Environment\n", + " 2024-02-09 16:25:49.935999870 BAA-1104045 Enter Environment\n", + " 2024-02-09 16:26:07.579999924 BAA-1104047 Enter Environment,\n", + " 'AEON4': id type region\n", + " time \n", + " 2024-01-31 10:22:40.191999912 BAA-1104048 Enter Environment\n", + " 2024-02-01 20:46:53.905536175 BAA-1104048 Remain Environment\n", + " 2024-02-01 23:34:58.098527908 BAA-1104048 Remain Environment\n", + " 2024-02-01 23:40:29.825535774 BAA-1104048 Remain Environment\n", + " 2024-02-03 16:34:00.159999847 BAA-1104048 Exit Environment\n", + " 2024-02-05 14:59:57.992000103 BAA-1104049 Enter Environment\n", + " 2024-02-08 14:54:20.616000175 BAA-1104049 Exit Environment\n", + " 2024-02-09 16:48:31.208000183 BAA-1104048 Enter Environment\n", + " 2024-02-09 16:48:44.848000050 BAA-1104049 Enter Environment\n", + " 2024-02-13 15:06:53.121535778 BAA-1104048 Remain Environment\n", + " 2024-02-13 15:06:53.121535778 BAA-1104049 Remain Environment\n", + " 2024-02-13 15:09:16.763519764 BAA-1104048 Remain Environment\n", + " 2024-02-13 15:09:16.763519764 BAA-1104049 Remain Environment\n", + " 2024-02-13 15:20:19.109536171 BAA-1104048 Remain Environment\n", + " 2024-02-13 15:20:19.109536171 BAA-1104049 Remain Environment\n", + " 2024-02-13 15:23:22.901535988 BAA-1104048 Remain Environment\n", + " 2024-02-13 15:23:22.901535988 BAA-1104049 Remain Environment\n", + " 2024-02-13 15:26:20.574528217 BAA-1104048 Remain Environment\n", + " 2024-02-13 15:26:20.574528217 BAA-1104049 Remain Environment\n", + " 2024-02-13 15:31:09.248511791 BAA-1104048 Remain Environment\n", + " 2024-02-13 15:31:09.248511791 BAA-1104049 Remain Environment\n", + " 2024-02-13 15:32:04.505536079 BAA-1104048 Remain Environment}" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "subject_env_visits" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"Fill out blocks df.\"\"\"\n", + "\n", + "for i, block in enumerate(blocks_df.itertuples()):\n", + " # Compute block duration\n", + " blocks_df.at[block.Index, \"block_duration\"] = block.end - block.start\n", + " # \n", + " # pd.Timedelta(\"1s\"))\n", + " if cum_pel_ct < good_block_pel_ct:\n", + " continue\n", + " # /s>\n", + " # \n", + " # patch_info\n", + " cum_wheel_dist_dm = DotMap() # -> cum_wheel_dist\n", + " pellets_stats_df = pd.DataFrame(columns=[\"time\", \"patch\", \"threshold\", \"id\"]) # -> pellet_info\n", + " for i, patch in enumerate(patches):\n", + " # \n", + " # pd.Timedelta(\"1s\"), (True,)))\n", + " patch_df_for_pellets_df = patch_df[patch_df_good_indxs].reset_index()[[\"time\", \"threshold\"]]\n", + " patch_df_for_pellets_df[\"patch\"] = patch\n", + " patch_df_for_pellets_df[\"id\"] = None\n", + " patch_df_for_pellets_df.dropna(subset=[\"threshold\"], inplace=True)\n", + " # drop 1st val as is from block start\n", + " patch_df_for_pellets_df = patch_df_for_pellets_df.iloc[1:].reset_index(drop=True)\n", + " # /ss>\n", + " # \n", + " # \n", + " # \n", + " # #/sss> #/ss>\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + " # /s>\n", + " blocks_df.at[block.Index, \"patch_info\"] = patch_stats_df\n", + " blocks_df.at[block.Index, \"pellet_info\"] = pellets_stats_df\n", + " blocks_df.at[block.Index, \"cum_wheel_dist\"] = cum_wheel_dist_dm\n", + "\n", + "display(blocks_df)" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": {}, + "outputs": [], + "source": [ + "block = list(blocks_df.itertuples())[4]" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "c:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "c:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\1365078609.py:86: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[82], line 41\u001b[0m\n\u001b[0;32m 38\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, patch \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(patches):\n\u001b[0;32m 39\u001b[0m \u001b[38;5;66;03m# 41\u001b[0m wheel_df \u001b[38;5;241m=\u001b[39m \u001b[43maeon\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload\u001b[49m\u001b[43m(\u001b[49m\u001b[43mblock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mroot\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mr\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mblock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstart\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mblock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mend\u001b[49m\u001b[43m)\u001b[49m[::\u001b[38;5;241m50\u001b[39m]\n\u001b[0;32m 42\u001b[0m cum_wheel_dist \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m-\u001b[39mdistancetravelled(wheel_df\u001b[38;5;241m.\u001b[39mangle)\n\u001b[0;32m 43\u001b[0m \u001b[38;5;66;03m# /ss>\u001b[39;00m\n\u001b[0;32m 44\u001b[0m \u001b[38;5;66;03m# 86\u001b[0m fileset \u001b[38;5;241m=\u001b[39m \u001b[43m{\u001b[49m\n\u001b[0;32m 87\u001b[0m \u001b[43m \u001b[49m\u001b[43mchunk_key\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfname\u001b[49m\u001b[43m)\u001b[49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mfname\u001b[49m\n\u001b[0;32m 88\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mroot\u001b[49m\n\u001b[0;32m 89\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mfname\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mglob\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43mf\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mepoch_pattern\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[38;5;124;43m/**/\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mreader\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpattern\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[38;5;124;43m.\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mreader\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mextension\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[0;32m 90\u001b[0m \u001b[43m\u001b[49m\u001b[43m}\u001b[49m\n\u001b[0;32m 91\u001b[0m files \u001b[38;5;241m=\u001b[39m \u001b[38;5;28msorted\u001b[39m(fileset\u001b[38;5;241m.\u001b[39mitems())\n\u001b[0;32m 93\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m time \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m 94\u001b[0m \u001b[38;5;66;03m# ensure input is converted to timestamp series\u001b[39;00m\n", + "File \u001b[1;32mc:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:86\u001b[0m, in \u001b[0;36m\u001b[1;34m(.0)\u001b[0m\n\u001b[0;32m 83\u001b[0m root \u001b[38;5;241m=\u001b[39m [root]\n\u001b[0;32m 85\u001b[0m epoch_pattern \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m**\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m epoch \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;28;01melse\u001b[39;00m epoch\n\u001b[1;32m---> 86\u001b[0m fileset \u001b[38;5;241m=\u001b[39m {\n\u001b[0;32m 87\u001b[0m chunk_key(fname): fname\n\u001b[0;32m 88\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m path \u001b[38;5;129;01min\u001b[39;00m root\n\u001b[0;32m 89\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m fname \u001b[38;5;129;01min\u001b[39;00m path\u001b[38;5;241m.\u001b[39mglob(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mepoch_pattern\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m/**/\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mreader\u001b[38;5;241m.\u001b[39mpattern\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m.\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mreader\u001b[38;5;241m.\u001b[39mextension\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 90\u001b[0m }\n\u001b[0;32m 91\u001b[0m files \u001b[38;5;241m=\u001b[39m \u001b[38;5;28msorted\u001b[39m(fileset\u001b[38;5;241m.\u001b[39mitems())\n\u001b[0;32m 93\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m time \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m 94\u001b[0m \u001b[38;5;66;03m# ensure input is converted to timestamp series\u001b[39;00m\n", + "File \u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\pathlib.py:953\u001b[0m, in \u001b[0;36mPath.glob\u001b[1;34m(self, pattern)\u001b[0m\n\u001b[0;32m 951\u001b[0m pattern_parts\u001b[38;5;241m.\u001b[39mappend(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m 952\u001b[0m selector \u001b[38;5;241m=\u001b[39m _make_selector(\u001b[38;5;28mtuple\u001b[39m(pattern_parts), \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_flavour)\n\u001b[1;32m--> 953\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m p \u001b[38;5;129;01min\u001b[39;00m selector\u001b[38;5;241m.\u001b[39mselect_from(\u001b[38;5;28mself\u001b[39m):\n\u001b[0;32m 954\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m p\n", + "File \u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\pathlib.py:408\u001b[0m, in \u001b[0;36m_RecursiveWildcardSelector._select_from\u001b[1;34m(self, parent_path, is_dir, exists, scandir)\u001b[0m\n\u001b[0;32m 406\u001b[0m successor_select \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msuccessor\u001b[38;5;241m.\u001b[39m_select_from\n\u001b[0;32m 407\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m starting_point \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_iterate_directories(parent_path, is_dir, scandir):\n\u001b[1;32m--> 408\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m p \u001b[38;5;129;01min\u001b[39;00m successor_select(starting_point, is_dir, exists, scandir):\n\u001b[0;32m 409\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m p \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m yielded:\n\u001b[0;32m 410\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m p\n", + "File \u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\pathlib.py:408\u001b[0m, in \u001b[0;36m_RecursiveWildcardSelector._select_from\u001b[1;34m(self, parent_path, is_dir, exists, scandir)\u001b[0m\n\u001b[0;32m 406\u001b[0m successor_select \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msuccessor\u001b[38;5;241m.\u001b[39m_select_from\n\u001b[0;32m 407\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m starting_point \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_iterate_directories(parent_path, is_dir, scandir):\n\u001b[1;32m--> 408\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m p \u001b[38;5;129;01min\u001b[39;00m successor_select(starting_point, is_dir, exists, scandir):\n\u001b[0;32m 409\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m p \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m yielded:\n\u001b[0;32m 410\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m p\n", + "File \u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\pathlib.py:356\u001b[0m, in \u001b[0;36m_WildcardSelector._select_from\u001b[1;34m(self, parent_path, is_dir, exists, scandir)\u001b[0m\n\u001b[0;32m 354\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 355\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m scandir(parent_path) \u001b[38;5;28;01mas\u001b[39;00m scandir_it:\n\u001b[1;32m--> 356\u001b[0m entries \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlist\u001b[39m(scandir_it)\n\u001b[0;32m 357\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m entry \u001b[38;5;129;01min\u001b[39;00m entries:\n\u001b[0;32m 358\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdironly:\n", + "\u001b[1;31mKeyboardInterrupt\u001b[0m: " + ] + } + ], + "source": [ + " blocks_df.at[block.Index, \"block_duration\"] = block.end - block.start\n", + " # /s>\n", + " # \n", + " # \n", + " # \n", + " # pd.Timedelta(\"1s\"), (True,)))\n", + " patch_df_for_pellets_df = patch_df[patch_df_good_indxs].reset_index()[[\"time\", \"threshold\"]]\n", + " patch_df_for_pellets_df[\"patch\"] = patch\n", + " patch_df_for_pellets_df[\"id\"] = None\n", + " patch_df_for_pellets_df.dropna(subset=[\"threshold\"], inplace=True)\n", + " # drop 1st val as is from block start\n", + " patch_df_for_pellets_df = patch_df_for_pellets_df.iloc[1:].reset_index(drop=True)\n", + " # /ss>\n", + " # \n", + " # \n", + " # Get closest subject to patch at each pel del timestep\n", + " patch_df_for_pellets_df[\"id\"] = dist_to_patch_pel_ts_id_df.idxmin(axis=1).values\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + " # /ss> /s>\n", + " blocks_df.at[block.Index, \"patch_info\"] = patch_stats_df\n", + " blocks_df.at[block.Index, \"pellet_info\"] = pellets_stats_df\n", + " blocks_df.at[block.Index, \"cum_wheel_dist\"] = cum_wheel_dist_dm\n" + ] + }, + { + "cell_type": "code", + "execution_count": 93, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "c:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
classclass_likelihoodpartxypart_likelihood
time
2024-02-14 08:00:00.019999981BAA-11040450.987112centroid1259.260010536.5432740.538822
2024-02-14 08:00:00.019999981BAA-11040470.587085centroid1269.920776555.0076900.538822
2024-02-14 08:00:00.079999924BAA-11040450.997696centroid1256.660889536.3559570.524928
2024-02-14 08:00:00.079999924BAA-11040450.525753centroid1272.174805555.1944580.524928
2024-02-14 08:00:00.139999866BAA-11040450.993752centroid1256.811279539.0522460.495777
.....................
2024-02-14 08:59:59.840000153BAA-11040450.764098centroid595.052551368.5387880.951113
2024-02-14 08:59:59.840000153BAA-11040450.847785centroid1299.120605498.8926390.951113
2024-02-14 08:59:59.900000095BAA-11040450.668274centroid595.155579368.4370730.983769
2024-02-14 08:59:59.900000095BAA-11040470.853135centroid1299.102173496.8677370.983769
2024-02-14 08:59:59.960000038BAA-11040470.596216centroid595.175049368.3803410.979406
\n", + "

110635 rows × 6 columns

\n", + "
" + ], + "text/plain": [ + " class class_likelihood part \\\n", + "time \n", + "2024-02-14 08:00:00.019999981 BAA-1104045 0.987112 centroid \n", + "2024-02-14 08:00:00.019999981 BAA-1104047 0.587085 centroid \n", + "2024-02-14 08:00:00.079999924 BAA-1104045 0.997696 centroid \n", + "2024-02-14 08:00:00.079999924 BAA-1104045 0.525753 centroid \n", + "2024-02-14 08:00:00.139999866 BAA-1104045 0.993752 centroid \n", + "... ... ... ... \n", + "2024-02-14 08:59:59.840000153 BAA-1104045 0.764098 centroid \n", + "2024-02-14 08:59:59.840000153 BAA-1104045 0.847785 centroid \n", + "2024-02-14 08:59:59.900000095 BAA-1104045 0.668274 centroid \n", + "2024-02-14 08:59:59.900000095 BAA-1104047 0.853135 centroid \n", + "2024-02-14 08:59:59.960000038 BAA-1104047 0.596216 centroid \n", + "\n", + " x y part_likelihood \n", + "time \n", + "2024-02-14 08:00:00.019999981 1259.260010 536.543274 0.538822 \n", + "2024-02-14 08:00:00.019999981 1269.920776 555.007690 0.538822 \n", + "2024-02-14 08:00:00.079999924 1256.660889 536.355957 0.524928 \n", + "2024-02-14 08:00:00.079999924 1272.174805 555.194458 0.524928 \n", + "2024-02-14 08:00:00.139999866 1256.811279 539.052246 0.495777 \n", + "... ... ... ... \n", + "2024-02-14 08:59:59.840000153 595.052551 368.538788 0.951113 \n", + "2024-02-14 08:59:59.840000153 1299.120605 498.892639 0.951113 \n", + "2024-02-14 08:59:59.900000095 595.155579 368.437073 0.983769 \n", + "2024-02-14 08:59:59.900000095 1299.102173 496.867737 0.983769 \n", + "2024-02-14 08:59:59.960000038 595.175049 368.380341 0.979406 \n", + "\n", + "[110635 rows x 6 columns]" + ] + }, + "execution_count": 93, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "start, end = pd.Timestamp(\"2024-02-14 08:00:00\"), pd.Timestamp(\"2024-02-14 09:00:00\")\n", + "pose_df = aeon.load(block.root, social02.CameraTop.Pose, start, end)\n", + "pose_df = reader.Pose.class_int2str(pose_df, block.sleap_model_dir)\n", + "pose_df" + ] + }, + { + "cell_type": "code", + "execution_count": 105, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "c:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n" + ] + } + ], + "source": [ + "cum_wheel_dist_dm = DotMap()\n", + "patch_stats_df = pd.DataFrame(index=patches, columns=[\"mean\", \"offset\"])\n", + "pellets_stats_df = pd.DataFrame(columns=[\"time\", \"patch\", \"threshold\", \"id\"])\n", + "\n", + "r = eval(f\"social02.{patch}.Encoder\")\n", + "wheel_df = aeon.load(block.root, r, start, end)[::50].round(1).astype(np.float32)\n", + "cum_wheel_dist = -distancetravelled(wheel_df.angle)\n", + "# /ss>\n", + "# pd.Timedelta(\"1s\"), (True,)))\n", + "patch_df_for_pellets_df = patch_df[patch_df_good_indxs].reset_index()[[\"time\", \"threshold\"]]\n", + "patch_df_for_pellets_df[\"patch\"] = patch\n", + "patch_df_for_pellets_df[\"id\"] = None\n", + "patch_df_for_pellets_df.dropna(subset=[\"threshold\"], inplace=True)\n", + "# drop 1st val as is from block start\n", + "patch_df_for_pellets_df = patch_df_for_pellets_df.iloc[1:].reset_index(drop=True)\n", + "# /ss>\n", + "# \n", + " # \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BAA-1104045
time
2024-02-14 08:00:00.000000000-0.000000
2024-02-14 08:00:00.0999999050.001534
2024-02-14 08:00:00.199999809-0.006136
2024-02-14 08:00:00.300000191-0.001534
2024-02-14 08:00:00.400000095-0.003068
......
2024-02-14 08:59:59.5000000004394.620038
2024-02-14 08:59:59.5999999054394.618504
2024-02-14 08:59:59.6999998094394.615436
2024-02-14 08:59:59.8000001914394.615436
2024-02-14 08:59:59.9000000954394.618504
\n", + "

36000 rows × 1 columns

\n", + "" + ], + "text/plain": [ + " BAA-1104045\n", + "time \n", + "2024-02-14 08:00:00.000000000 -0.000000\n", + "2024-02-14 08:00:00.099999905 0.001534\n", + "2024-02-14 08:00:00.199999809 -0.006136\n", + "2024-02-14 08:00:00.300000191 -0.001534\n", + "2024-02-14 08:00:00.400000095 -0.003068\n", + "... ...\n", + "2024-02-14 08:59:59.500000000 4394.620038\n", + "2024-02-14 08:59:59.599999905 4394.618504\n", + "2024-02-14 08:59:59.699999809 4394.615436\n", + "2024-02-14 08:59:59.800000191 4394.615436\n", + "2024-02-14 08:59:59.900000095 4394.618504\n", + "\n", + "[36000 rows x 1 columns]" + ] + }, + "execution_count": 163, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Convert series to df with column name \"subject\"\n", + "cum_wheel_dist.to_frame(name=subjects[0])" + ] + }, + { + "cell_type": "code", + "execution_count": 155, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BAA-1104045BAA-1104047
time
2024-02-14 08:00:00.000000000-0.0000000.000000
2024-02-14 08:00:00.0999999050.0015340.000000
2024-02-14 08:00:00.199999809-0.0061360.000000
2024-02-14 08:00:00.300000191-0.0015340.000000
2024-02-14 08:00:00.400000095-0.0030680.000000
.........
2024-02-14 08:59:59.5000000001247.8268723146.785496
2024-02-14 08:59:59.5999999051247.8253383146.785496
2024-02-14 08:59:59.6999998091247.8253383146.782427
2024-02-14 08:59:59.8000001911247.8253383146.782427
2024-02-14 08:59:59.9000000951247.8284063146.782427
\n", + "

36000 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " BAA-1104045 BAA-1104047\n", + "time \n", + "2024-02-14 08:00:00.000000000 -0.000000 0.000000\n", + "2024-02-14 08:00:00.099999905 0.001534 0.000000\n", + "2024-02-14 08:00:00.199999809 -0.006136 0.000000\n", + "2024-02-14 08:00:00.300000191 -0.001534 0.000000\n", + "2024-02-14 08:00:00.400000095 -0.003068 0.000000\n", + "... ... ...\n", + "2024-02-14 08:59:59.500000000 1247.826872 3146.785496\n", + "2024-02-14 08:59:59.599999905 1247.825338 3146.785496\n", + "2024-02-14 08:59:59.699999809 1247.825338 3146.782427\n", + "2024-02-14 08:59:59.800000191 1247.825338 3146.782427\n", + "2024-02-14 08:59:59.900000095 1247.828406 3146.782427\n", + "\n", + "[36000 rows x 2 columns]" + ] + }, + "execution_count": 155, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cum_wheel_dist_dm[subjects[0]][patch]" + ] + }, + { + "cell_type": "code", + "execution_count": 150, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\3670313934.py:2: FutureWarning: The behavior of DataFrame.idxmin with all-NA values, or any-NA and skipna=False, is deprecated. In a future version this will raise ValueError\n", + " closest_subjects = dist_to_patch_wheel_ts_id_df.idxmin(axis=1)\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BAA-1104045BAA-1104047
time
2024-02-14 08:00:00.000000000-0.0000000.000000
2024-02-14 08:00:00.0999999050.0015340.001534
2024-02-14 08:00:00.199999809-0.007670-0.007670
2024-02-14 08:00:00.3000001910.0046020.004602
2024-02-14 08:00:00.400000095-0.001534-0.001534
.........
2024-02-14 08:59:59.500000000-0.001534-0.001534
2024-02-14 08:59:59.599999905-0.001534-0.001534
2024-02-14 08:59:59.6999998090.000000-0.003068
2024-02-14 08:59:59.8000001910.0000000.000000
2024-02-14 08:59:59.9000000950.0030680.003068
\n", + "

36000 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " BAA-1104045 BAA-1104047\n", + "time \n", + "2024-02-14 08:00:00.000000000 -0.000000 0.000000\n", + "2024-02-14 08:00:00.099999905 0.001534 0.001534\n", + "2024-02-14 08:00:00.199999809 -0.007670 -0.007670\n", + "2024-02-14 08:00:00.300000191 0.004602 0.004602\n", + "2024-02-14 08:00:00.400000095 -0.001534 -0.001534\n", + "... ... ...\n", + "2024-02-14 08:59:59.500000000 -0.001534 -0.001534\n", + "2024-02-14 08:59:59.599999905 -0.001534 -0.001534\n", + "2024-02-14 08:59:59.699999809 0.000000 -0.003068\n", + "2024-02-14 08:59:59.800000191 0.000000 0.000000\n", + "2024-02-14 08:59:59.900000095 0.003068 0.003068\n", + "\n", + "[36000 rows x 2 columns]" + ] + }, + "execution_count": 150, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cum_wheel_dist_subj_df = pd.DataFrame(index=cum_wheel_dist.index, columns=subjects, data=0.0)\n", + "closest_subjects = dist_to_patch_wheel_ts_id_df.idxmin(axis=1)\n", + "wheel_dist = cum_wheel_dist.diff().fillna(cum_wheel_dist.iloc[0])\n", + "for subject in subjects:\n", + " subj_idxs = cum_wheel_dist_subj_df[closest_subjects == subject].index\n", + " cum_wheel_dist_subj_df.loc[subj_idxs, subject] = wheel_dist[closest_subjects == subject]\n", + "cum_wheel_dist_subj_df.cumsum(axis=1)" + ] + }, + { + "cell_type": "code", + "execution_count": 136, + "metadata": {}, + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'DataFrame' object has no attribute 'subject'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m~\\AppData\\Local\\Temp\\ipykernel_63676\\475597327.py\u001b[0m in \u001b[0;36m?\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mcum_wheel_dist_subj_df\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msubject\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mclosest_subjects\u001b[0m \u001b[1;33m==\u001b[0m \u001b[0msubject\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\site-packages\\pandas\\core\\generic.py\u001b[0m in \u001b[0;36m?\u001b[1;34m(self, name)\u001b[0m\n\u001b[0;32m 6198\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mname\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_accessors\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6199\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_info_axis\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_can_hold_identifiers_and_holds_name\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6200\u001b[0m ):\n\u001b[0;32m 6201\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 6202\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mobject\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__getattribute__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mAttributeError\u001b[0m: 'DataFrame' object has no attribute 'subject'" + ] + } + ], + "source": [ + "cum_wheel_dist_subj_df[subject][closest_subjects == subject]" + ] + }, + { + "cell_type": "code", + "execution_count": 144, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\434192056.py:2: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[ 0.00153407 0. -0.00460222 ... -0.00153407 0.\n", + " -0.00306815]' has dtype incompatible with int64, please explicitly cast to a compatible dtype first.\n", + " cum_wheel_dist_subj_df.loc[subj_idxs, subject] = wheel_dist[closest_subjects == subject]\n" + ] + } + ], + "source": [ + "subj_idxs = cum_wheel_dist_subj_df[closest_subjects == subject].index\n", + "cum_wheel_dist_subj_df.loc[subj_idxs, subject] = wheel_dist[closest_subjects == subject]" + ] + }, + { + "cell_type": "code", + "execution_count": 148, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "time\n", + "2024-02-14 08:00:00.000000000 -0.000000\n", + "2024-02-14 08:00:00.099999905 0.001534\n", + "2024-02-14 08:00:00.199999809 -0.006136\n", + "2024-02-14 08:00:00.300000191 -0.001534\n", + "2024-02-14 08:00:00.400000095 -0.003068\n", + " ... \n", + "2024-02-14 08:59:59.500000000 4394.620038\n", + "2024-02-14 08:59:59.599999905 4394.618504\n", + "2024-02-14 08:59:59.699999809 4394.615436\n", + "2024-02-14 08:59:59.800000191 4394.615436\n", + "2024-02-14 08:59:59.900000095 4394.618504\n", + "Name: angle, Length: 36000, dtype: float64" + ] + }, + "execution_count": 148, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cum_wheel_dist" + ] + }, + { + "cell_type": "code", + "execution_count": 146, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "time\n", + "2024-02-14 08:00:03.699999809 0.001534\n", + "2024-02-14 08:00:03.800000191 0.001534\n", + "2024-02-14 08:00:03.900000095 -0.003068\n", + "2024-02-14 08:00:04.000000000 0.001534\n", + "2024-02-14 08:00:04.099999905 0.000000\n", + " ... \n", + "2024-02-14 08:59:58.699999809 3146.783961\n", + "2024-02-14 08:59:58.900000095 3146.787030\n", + "2024-02-14 08:59:59.000000000 3146.785496\n", + "2024-02-14 08:59:59.300000191 3146.785496\n", + "2024-02-14 08:59:59.699999809 3146.782427\n", + "Name: angle, Length: 21992, dtype: float64" + ] + }, + "execution_count": 146, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "wheel_dist[closest_subjects == subject].cumsum()" + ] + }, + { + "cell_type": "code", + "execution_count": 145, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BAA-1104045BAA-1104047
time
2024-02-14 08:00:00.00000000000.000000
2024-02-14 08:00:00.09999990500.000000
2024-02-14 08:00:00.19999980900.000000
2024-02-14 08:00:00.30000019100.000000
2024-02-14 08:00:00.40000009500.000000
.........
2024-02-14 08:59:59.50000000000.000000
2024-02-14 08:59:59.59999990500.000000
2024-02-14 08:59:59.6999998090-0.003068
2024-02-14 08:59:59.80000019100.000000
2024-02-14 08:59:59.90000009500.000000
\n", + "

36000 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " BAA-1104045 BAA-1104047\n", + "time \n", + "2024-02-14 08:00:00.000000000 0 0.000000\n", + "2024-02-14 08:00:00.099999905 0 0.000000\n", + "2024-02-14 08:00:00.199999809 0 0.000000\n", + "2024-02-14 08:00:00.300000191 0 0.000000\n", + "2024-02-14 08:00:00.400000095 0 0.000000\n", + "... ... ...\n", + "2024-02-14 08:59:59.500000000 0 0.000000\n", + "2024-02-14 08:59:59.599999905 0 0.000000\n", + "2024-02-14 08:59:59.699999809 0 -0.003068\n", + "2024-02-14 08:59:59.800000191 0 0.000000\n", + "2024-02-14 08:59:59.900000095 0 0.000000\n", + "\n", + "[36000 rows x 2 columns]" + ] + }, + "execution_count": 145, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cum_wheel_dist_subj_df" + ] + }, + { + "cell_type": "code", + "execution_count": 138, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'BAA-1104047'" + ] + }, + "execution_count": 138, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "subject" + ] + }, + { + "cell_type": "code", + "execution_count": 139, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "time\n", + "2024-02-14 08:00:00.000000000 0\n", + "2024-02-14 08:00:00.099999905 0\n", + "2024-02-14 08:00:00.199999809 0\n", + "2024-02-14 08:00:00.300000191 0\n", + "2024-02-14 08:00:00.400000095 0\n", + " ..\n", + "2024-02-14 08:59:59.500000000 0\n", + "2024-02-14 08:59:59.599999905 0\n", + "2024-02-14 08:59:59.699999809 0\n", + "2024-02-14 08:59:59.800000191 0\n", + "2024-02-14 08:59:59.900000095 0\n", + "Name: BAA-1104047, Length: 36000, dtype: int64" + ] + }, + "execution_count": 139, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cum_wheel_dist_subj_df[subject]" + ] + }, + { + "cell_type": "code", + "execution_count": 133, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'BAA-1104047'" + ] + }, + "execution_count": 133, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "subject" + ] + }, + { + "cell_type": "code", + "execution_count": 131, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "time\n", + "2024-02-14 08:00:03.699999809 0.001534\n", + "2024-02-14 08:00:03.800000191 0.000000\n", + "2024-02-14 08:00:03.900000095 -0.004602\n", + "2024-02-14 08:00:04.000000000 0.004602\n", + "2024-02-14 08:00:04.099999905 -0.001534\n", + " ... \n", + "2024-02-14 08:59:58.699999809 0.003068\n", + "2024-02-14 08:59:58.900000095 0.003068\n", + "2024-02-14 08:59:59.000000000 -0.001534\n", + "2024-02-14 08:59:59.300000191 0.000000\n", + "2024-02-14 08:59:59.699999809 -0.003068\n", + "Name: angle, Length: 21992, dtype: float64" + ] + }, + "execution_count": 131, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "wheel_dist[closest_subjects == subject]" + ] + }, + { + "cell_type": "code", + "execution_count": 127, + "metadata": {}, + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'DataFrame' object has no attribute 'subject'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m~\\AppData\\Local\\Temp\\ipykernel_63676\\475597327.py\u001b[0m in \u001b[0;36m?\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mcum_wheel_dist_subj_df\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msubject\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mclosest_subjects\u001b[0m \u001b[1;33m==\u001b[0m \u001b[0msubject\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\site-packages\\pandas\\core\\generic.py\u001b[0m in \u001b[0;36m?\u001b[1;34m(self, name)\u001b[0m\n\u001b[0;32m 6198\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mname\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_accessors\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6199\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_info_axis\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_can_hold_identifiers_and_holds_name\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6200\u001b[0m ):\n\u001b[0;32m 6201\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 6202\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mobject\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__getattribute__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mAttributeError\u001b[0m: 'DataFrame' object has no attribute 'subject'" + ] + } + ], + "source": [ + "cum_wheel_dist_subj_df.subject[closest_subjects == subject]" + ] + }, + { + "cell_type": "code", + "execution_count": 125, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\332053637.py:2: FutureWarning: The behavior of DataFrame.idxmin with all-NA values, or any-NA and skipna=False, is deprecated. In a future version this will raise ValueError\n", + " closest_subjects = dist_to_patch_wheel_ts_id_df.idxmin(axis=1)\n" + ] + } + ], + "source": [ + "cum_wheel_dist_subj_df = pd.DataFrame(index=cum_wheel_dist.index, columns=subjects, data=0)\n", + "closest_subjects = dist_to_patch_wheel_ts_id_df.idxmin(axis=1)\n", + "wheel_dist = cum_wheel_dist.diff().fillna(cum_wheel_dist.iloc[0])" + ] + }, + { + "cell_type": "code", + "execution_count": 126, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "time\n", + "2024-02-14 08:00:03.699999809 0.001534\n", + "2024-02-14 08:00:03.800000191 0.000000\n", + "2024-02-14 08:00:03.900000095 -0.004602\n", + "2024-02-14 08:00:04.000000000 0.004602\n", + "2024-02-14 08:00:04.099999905 -0.001534\n", + " ... \n", + "2024-02-14 08:59:58.699999809 0.003068\n", + "2024-02-14 08:59:58.900000095 0.003068\n", + "2024-02-14 08:59:59.000000000 -0.001534\n", + "2024-02-14 08:59:59.300000191 0.000000\n", + "2024-02-14 08:59:59.699999809 -0.003068\n", + "Name: angle, Length: 21992, dtype: float64" + ] + }, + "execution_count": 126, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "wheel_dist[closest_subjects == subject]" + ] + }, + { + "cell_type": "code", + "execution_count": 122, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "time\n", + "2024-02-14 08:00:00.000000000 -0.000000\n", + "2024-02-14 08:00:00.099999905 0.001534\n", + "2024-02-14 08:00:00.199999809 -0.006136\n", + "2024-02-14 08:00:00.300000191 -0.001534\n", + "2024-02-14 08:00:00.400000095 -0.003068\n", + " ... \n", + "2024-02-14 08:59:59.500000000 4394.620038\n", + "2024-02-14 08:59:59.599999905 4394.618504\n", + "2024-02-14 08:59:59.699999809 4394.615436\n", + "2024-02-14 08:59:59.800000191 4394.615436\n", + "2024-02-14 08:59:59.900000095 4394.618504\n", + "Name: angle, Length: 36000, dtype: float64" + ] + }, + "execution_count": 122, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cum_wheel_dist" + ] + }, + { + "cell_type": "code", + "execution_count": 124, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "time\n", + "2024-02-14 08:00:00.000000000 NaN\n", + "2024-02-14 08:00:00.099999905 0.001534\n", + "2024-02-14 08:00:00.199999809 -0.007670\n", + "2024-02-14 08:00:00.300000191 0.004602\n", + "2024-02-14 08:00:00.400000095 -0.001534\n", + " ... \n", + "2024-02-14 08:59:59.500000000 -0.001534\n", + "2024-02-14 08:59:59.599999905 -0.001534\n", + "2024-02-14 08:59:59.699999809 -0.003068\n", + "2024-02-14 08:59:59.800000191 0.000000\n", + "2024-02-14 08:59:59.900000095 0.003068\n", + "Name: angle, Length: 36000, dtype: float64" + ] + }, + "execution_count": 124, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 118, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BAA-1104045BAA-1104047
time
2024-02-14 08:00:00.000000000693.885635698.566247
2024-02-14 08:00:00.099999905690.778328698.661071
2024-02-14 08:00:00.199999809690.418638698.643935
2024-02-14 08:00:00.300000191687.212969700.757699
2024-02-14 08:00:00.400000095683.109510700.926455
.........
2024-02-14 08:59:59.500000000384.701512741.401770
2024-02-14 08:59:59.599999905386.913748743.527414
2024-02-14 08:59:59.699999809743.851848384.906781
2024-02-14 08:59:59.800000191384.493044744.545220
2024-02-14 08:59:59.900000095384.593439744.545220
\n", + "

36000 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " BAA-1104045 BAA-1104047\n", + "time \n", + "2024-02-14 08:00:00.000000000 693.885635 698.566247\n", + "2024-02-14 08:00:00.099999905 690.778328 698.661071\n", + "2024-02-14 08:00:00.199999809 690.418638 698.643935\n", + "2024-02-14 08:00:00.300000191 687.212969 700.757699\n", + "2024-02-14 08:00:00.400000095 683.109510 700.926455\n", + "... ... ...\n", + "2024-02-14 08:59:59.500000000 384.701512 741.401770\n", + "2024-02-14 08:59:59.599999905 386.913748 743.527414\n", + "2024-02-14 08:59:59.699999809 743.851848 384.906781\n", + "2024-02-14 08:59:59.800000191 384.493044 744.545220\n", + "2024-02-14 08:59:59.900000095 384.593439 744.545220\n", + "\n", + "[36000 rows x 2 columns]" + ] + }, + "execution_count": 118, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dist_to_patch_wheel_ts_id_df" + ] + }, + { + "cell_type": "code", + "execution_count": 117, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BAA-1104045BAA-1104047
time
2024-02-14 08:02:19.219999790746.210657NaN
2024-02-14 08:02:43.84198379521.425895749.594314
2024-02-14 08:05:23.16998386421.432737380.245593
2024-02-14 08:11:36.375999928633.40308023.403707
2024-02-14 08:13:55.437983990567.54796723.516178
2024-02-14 08:14:07.480000019342.01459123.583132
2024-02-14 08:16:26.765984058276.62725523.568197
2024-02-14 08:19:22.361983776562.15601523.203993
2024-02-14 08:19:33.853983879539.38256524.981456
2024-02-14 08:22:26.412000179302.21972123.412274
2024-02-14 08:23:13.721983910NaN23.219379
2024-02-14 08:23:57.76800012613.15708725.565686
2024-02-14 08:24:20.10198402421.508134320.565067
2024-02-14 08:24:40.70598411621.739176684.281538
2024-02-14 08:26:23.029983997691.44632223.530254
2024-02-14 08:29:16.335999966248.76299723.449587
2024-02-14 08:34:36.980000019392.47572819.970090
2024-02-14 08:35:02.955999851680.25630823.376212
2024-02-14 08:42:52.768000126468.48743723.423807
2024-02-14 08:43:12.713984013384.99788823.517266
2024-02-14 08:45:27.19600009921.502719751.062865
2024-02-14 08:45:37.736000061450.582448NaN
2024-02-14 08:46:39.004000186555.656947387.174379
\n", + "
" + ], + "text/plain": [ + " BAA-1104045 BAA-1104047\n", + "time \n", + "2024-02-14 08:02:19.219999790 746.210657 NaN\n", + "2024-02-14 08:02:43.841983795 21.425895 749.594314\n", + "2024-02-14 08:05:23.169983864 21.432737 380.245593\n", + "2024-02-14 08:11:36.375999928 633.403080 23.403707\n", + "2024-02-14 08:13:55.437983990 567.547967 23.516178\n", + "2024-02-14 08:14:07.480000019 342.014591 23.583132\n", + "2024-02-14 08:16:26.765984058 276.627255 23.568197\n", + "2024-02-14 08:19:22.361983776 562.156015 23.203993\n", + "2024-02-14 08:19:33.853983879 539.382565 24.981456\n", + "2024-02-14 08:22:26.412000179 302.219721 23.412274\n", + "2024-02-14 08:23:13.721983910 NaN 23.219379\n", + "2024-02-14 08:23:57.768000126 13.157087 25.565686\n", + "2024-02-14 08:24:20.101984024 21.508134 320.565067\n", + "2024-02-14 08:24:40.705984116 21.739176 684.281538\n", + "2024-02-14 08:26:23.029983997 691.446322 23.530254\n", + "2024-02-14 08:29:16.335999966 248.762997 23.449587\n", + "2024-02-14 08:34:36.980000019 392.475728 19.970090\n", + "2024-02-14 08:35:02.955999851 680.256308 23.376212\n", + "2024-02-14 08:42:52.768000126 468.487437 23.423807\n", + "2024-02-14 08:43:12.713984013 384.997888 23.517266\n", + "2024-02-14 08:45:27.196000099 21.502719 751.062865\n", + "2024-02-14 08:45:37.736000061 450.582448 NaN\n", + "2024-02-14 08:46:39.004000186 555.656947 387.174379" + ] + }, + "execution_count": 117, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dist_to_patch_pel_ts_id_df" + ] + }, + { + "cell_type": "code", + "execution_count": 116, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
timethresholdpatchid
02024-02-14 08:02:19.219999790361.785049Patch2BAA-1104045
12024-02-14 08:02:43.841983795194.950509Patch2BAA-1104045
22024-02-14 08:05:23.16998386488.046672Patch2BAA-1104045
32024-02-14 08:11:36.37599992885.945754Patch2BAA-1104047
42024-02-14 08:13:55.43798399076.270649Patch2BAA-1104047
52024-02-14 08:14:07.480000019205.543520Patch2BAA-1104047
62024-02-14 08:16:26.76598405888.423802Patch2BAA-1104047
72024-02-14 08:19:22.36198377696.462577Patch2BAA-1104047
82024-02-14 08:19:33.853983879132.625352Patch2BAA-1104047
92024-02-14 08:22:26.412000179372.380471Patch2BAA-1104047
102024-02-14 08:23:13.72198391088.550613Patch2BAA-1104047
112024-02-14 08:23:57.768000126158.293375Patch2BAA-1104045
122024-02-14 08:24:20.10198402494.946606Patch2BAA-1104045
132024-02-14 08:24:40.705984116128.350386Patch2BAA-1104045
142024-02-14 08:26:23.029983997103.003226Patch2BAA-1104047
152024-02-14 08:29:16.335999966439.736339Patch2BAA-1104047
162024-02-14 08:34:36.980000019241.119074Patch2BAA-1104047
172024-02-14 08:35:02.955999851209.483334Patch2BAA-1104047
182024-02-14 08:42:52.768000126169.083744Patch2BAA-1104047
192024-02-14 08:43:12.713984013146.062839Patch2BAA-1104047
202024-02-14 08:45:27.19600009988.638738Patch2BAA-1104045
212024-02-14 08:45:37.73600006180.205599Patch2BAA-1104045
222024-02-14 08:46:39.004000186205.907633Patch2BAA-1104047
\n", + "
" + ], + "text/plain": [ + " time threshold patch id\n", + "0 2024-02-14 08:02:19.219999790 361.785049 Patch2 BAA-1104045\n", + "1 2024-02-14 08:02:43.841983795 194.950509 Patch2 BAA-1104045\n", + "2 2024-02-14 08:05:23.169983864 88.046672 Patch2 BAA-1104045\n", + "3 2024-02-14 08:11:36.375999928 85.945754 Patch2 BAA-1104047\n", + "4 2024-02-14 08:13:55.437983990 76.270649 Patch2 BAA-1104047\n", + "5 2024-02-14 08:14:07.480000019 205.543520 Patch2 BAA-1104047\n", + "6 2024-02-14 08:16:26.765984058 88.423802 Patch2 BAA-1104047\n", + "7 2024-02-14 08:19:22.361983776 96.462577 Patch2 BAA-1104047\n", + "8 2024-02-14 08:19:33.853983879 132.625352 Patch2 BAA-1104047\n", + "9 2024-02-14 08:22:26.412000179 372.380471 Patch2 BAA-1104047\n", + "10 2024-02-14 08:23:13.721983910 88.550613 Patch2 BAA-1104047\n", + "11 2024-02-14 08:23:57.768000126 158.293375 Patch2 BAA-1104045\n", + "12 2024-02-14 08:24:20.101984024 94.946606 Patch2 BAA-1104045\n", + "13 2024-02-14 08:24:40.705984116 128.350386 Patch2 BAA-1104045\n", + "14 2024-02-14 08:26:23.029983997 103.003226 Patch2 BAA-1104047\n", + "15 2024-02-14 08:29:16.335999966 439.736339 Patch2 BAA-1104047\n", + "16 2024-02-14 08:34:36.980000019 241.119074 Patch2 BAA-1104047\n", + "17 2024-02-14 08:35:02.955999851 209.483334 Patch2 BAA-1104047\n", + "18 2024-02-14 08:42:52.768000126 169.083744 Patch2 BAA-1104047\n", + "19 2024-02-14 08:43:12.713984013 146.062839 Patch2 BAA-1104047\n", + "20 2024-02-14 08:45:27.196000099 88.638738 Patch2 BAA-1104045\n", + "21 2024-02-14 08:45:37.736000061 80.205599 Patch2 BAA-1104045\n", + "22 2024-02-14 08:46:39.004000186 205.907633 Patch2 BAA-1104047" + ] + }, + "execution_count": 116, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "patch_df_for_pellets_df" + ] + }, + { + "cell_type": "code", + "execution_count": 107, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
classdist_to_patch
time
2024-02-14 08:00:00.019999981BAA-1104045693.885635
2024-02-14 08:00:00.019999981BAA-1104047698.566247
2024-02-14 08:00:00.079999924BAA-1104045691.475353
2024-02-14 08:00:00.079999924BAA-1104045700.675389
2024-02-14 08:00:00.139999866BAA-1104045690.778328
.........
2024-02-14 08:59:59.840000153BAA-1104045384.493044
2024-02-14 08:59:59.840000153BAA-1104045743.868383
2024-02-14 08:59:59.900000095BAA-1104045384.593439
2024-02-14 08:59:59.900000095BAA-1104047744.545220
2024-02-14 08:59:59.960000038BAA-1104047384.649922
\n", + "

110635 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " class dist_to_patch\n", + "time \n", + "2024-02-14 08:00:00.019999981 BAA-1104045 693.885635\n", + "2024-02-14 08:00:00.019999981 BAA-1104047 698.566247\n", + "2024-02-14 08:00:00.079999924 BAA-1104045 691.475353\n", + "2024-02-14 08:00:00.079999924 BAA-1104045 700.675389\n", + "2024-02-14 08:00:00.139999866 BAA-1104045 690.778328\n", + "... ... ...\n", + "2024-02-14 08:59:59.840000153 BAA-1104045 384.493044\n", + "2024-02-14 08:59:59.840000153 BAA-1104045 743.868383\n", + "2024-02-14 08:59:59.900000095 BAA-1104045 384.593439\n", + "2024-02-14 08:59:59.900000095 BAA-1104047 744.545220\n", + "2024-02-14 08:59:59.960000038 BAA-1104047 384.649922\n", + "\n", + "[110635 rows x 2 columns]" + ] + }, + "execution_count": 107, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dist_to_patch_df" + ] + }, + { + "cell_type": "code", + "execution_count": 103, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BAA-1104045BAA-1104047
time
2024-02-14 08:00:00.000000000693.885635693.885635
2024-02-14 08:00:00.099999905690.778328690.778328
2024-02-14 08:00:00.199999809690.418638690.418638
2024-02-14 08:00:00.300000191687.212969687.212969
2024-02-14 08:00:00.400000095683.109510683.109510
.........
2024-02-14 08:59:59.500000000384.701512384.701512
2024-02-14 08:59:59.599999905386.913748386.913748
2024-02-14 08:59:59.699999809384.906781384.906781
2024-02-14 08:59:59.800000191384.493044384.493044
2024-02-14 08:59:59.900000095384.593439384.593439
\n", + "

36000 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " BAA-1104045 BAA-1104047\n", + "time \n", + "2024-02-14 08:00:00.000000000 693.885635 693.885635\n", + "2024-02-14 08:00:00.099999905 690.778328 690.778328\n", + "2024-02-14 08:00:00.199999809 690.418638 690.418638\n", + "2024-02-14 08:00:00.300000191 687.212969 687.212969\n", + "2024-02-14 08:00:00.400000095 683.109510 683.109510\n", + "... ... ...\n", + "2024-02-14 08:59:59.500000000 384.701512 384.701512\n", + "2024-02-14 08:59:59.599999905 386.913748 386.913748\n", + "2024-02-14 08:59:59.699999809 384.906781 384.906781\n", + "2024-02-14 08:59:59.800000191 384.493044 384.493044\n", + "2024-02-14 08:59:59.900000095 384.593439 384.593439\n", + "\n", + "[36000 rows x 2 columns]" + ] + }, + "execution_count": 103, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dist_to_patch_wheel_ts_id_df" + ] + }, + { + "cell_type": "code", + "execution_count": 102, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BAA-1104045BAA-1104047classdist_to_patch
time
2024-02-14 08:00:00.000000000693.885635NaNBAA-1104045693.885635
2024-02-14 08:00:00.099999905690.778328NaNBAA-1104045690.778328
2024-02-14 08:00:00.199999809690.418638NaNBAA-1104045690.418638
2024-02-14 08:00:00.300000191687.212969NaNBAA-1104045687.212969
2024-02-14 08:00:00.400000095683.109510NaNBAA-1104045683.109510
...............
2024-02-14 08:59:59.500000000384.701512NaNBAA-1104045384.701512
2024-02-14 08:59:59.599999905386.913748NaNBAA-1104045386.913748
2024-02-14 08:59:59.699999809384.906781NaNBAA-1104047384.906781
2024-02-14 08:59:59.800000191384.493044NaNBAA-1104045384.493044
2024-02-14 08:59:59.900000095384.593439NaNBAA-1104045384.593439
\n", + "

36000 rows × 4 columns

\n", + "
" + ], + "text/plain": [ + " BAA-1104045 BAA-1104047 class \\\n", + "time \n", + "2024-02-14 08:00:00.000000000 693.885635 NaN BAA-1104045 \n", + "2024-02-14 08:00:00.099999905 690.778328 NaN BAA-1104045 \n", + "2024-02-14 08:00:00.199999809 690.418638 NaN BAA-1104045 \n", + "2024-02-14 08:00:00.300000191 687.212969 NaN BAA-1104045 \n", + "2024-02-14 08:00:00.400000095 683.109510 NaN BAA-1104045 \n", + "... ... ... ... \n", + "2024-02-14 08:59:59.500000000 384.701512 NaN BAA-1104045 \n", + "2024-02-14 08:59:59.599999905 386.913748 NaN BAA-1104045 \n", + "2024-02-14 08:59:59.699999809 384.906781 NaN BAA-1104047 \n", + "2024-02-14 08:59:59.800000191 384.493044 NaN BAA-1104045 \n", + "2024-02-14 08:59:59.900000095 384.593439 NaN BAA-1104045 \n", + "\n", + " dist_to_patch \n", + "time \n", + "2024-02-14 08:00:00.000000000 693.885635 \n", + "2024-02-14 08:00:00.099999905 690.778328 \n", + "2024-02-14 08:00:00.199999809 690.418638 \n", + "2024-02-14 08:00:00.300000191 687.212969 \n", + "2024-02-14 08:00:00.400000095 683.109510 \n", + "... ... \n", + "2024-02-14 08:59:59.500000000 384.701512 \n", + "2024-02-14 08:59:59.599999905 386.913748 \n", + "2024-02-14 08:59:59.699999809 384.906781 \n", + "2024-02-14 08:59:59.800000191 384.493044 \n", + "2024-02-14 08:59:59.900000095 384.593439 \n", + "\n", + "[36000 rows x 4 columns]" + ] + }, + "execution_count": 102, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dist_to_patch_wheel_ts_subj" + ] + }, + { + "cell_type": "code", + "execution_count": 100, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BAA-1104045BAA-1104047classdist_to_patch
time
2024-02-14 08:02:19.219999790746.210657NaNBAA-1104045746.210657
2024-02-14 08:02:43.841983795749.594314NaNBAA-1104047749.594314
2024-02-14 08:05:23.169983864380.245593NaNBAA-1104047380.245593
2024-02-14 08:11:36.375999928633.403080NaNBAA-1104045633.403080
2024-02-14 08:13:55.43798399023.516178NaNBAA-110404723.516178
2024-02-14 08:14:07.48000001923.583132NaNBAA-110404723.583132
2024-02-14 08:16:26.76598405823.568197NaNBAA-110404723.568197
2024-02-14 08:19:22.361983776562.156015NaNBAA-1104045562.156015
2024-02-14 08:19:33.853983879539.382565NaNBAA-1104045539.382565
2024-02-14 08:22:26.41200017923.412274NaNBAA-110404723.412274
2024-02-14 08:23:13.72198391023.219379NaNBAA-110404723.219379
2024-02-14 08:23:57.76800012625.565686NaNBAA-110404725.565686
2024-02-14 08:24:20.10198402421.508134NaNBAA-110404521.508134
2024-02-14 08:24:40.705984116684.281538NaNBAA-1104047684.281538
2024-02-14 08:26:23.029983997691.446322NaNBAA-1104045691.446322
2024-02-14 08:29:16.33599996623.449587NaNBAA-110404723.449587
2024-02-14 08:34:36.980000019392.475728NaNBAA-1104045392.475728
2024-02-14 08:35:02.955999851680.256308NaNBAA-1104045680.256308
2024-02-14 08:42:52.76800012623.423807NaNBAA-110404723.423807
2024-02-14 08:43:12.713984013384.997888NaNBAA-1104045384.997888
2024-02-14 08:45:27.196000099751.062865NaNBAA-1104047751.062865
2024-02-14 08:45:37.736000061450.582448NaNBAA-1104045450.582448
2024-02-14 08:46:39.004000186555.656947NaNBAA-1104045555.656947
\n", + "
" + ], + "text/plain": [ + " BAA-1104045 BAA-1104047 class \\\n", + "time \n", + "2024-02-14 08:02:19.219999790 746.210657 NaN BAA-1104045 \n", + "2024-02-14 08:02:43.841983795 749.594314 NaN BAA-1104047 \n", + "2024-02-14 08:05:23.169983864 380.245593 NaN BAA-1104047 \n", + "2024-02-14 08:11:36.375999928 633.403080 NaN BAA-1104045 \n", + "2024-02-14 08:13:55.437983990 23.516178 NaN BAA-1104047 \n", + "2024-02-14 08:14:07.480000019 23.583132 NaN BAA-1104047 \n", + "2024-02-14 08:16:26.765984058 23.568197 NaN BAA-1104047 \n", + "2024-02-14 08:19:22.361983776 562.156015 NaN BAA-1104045 \n", + "2024-02-14 08:19:33.853983879 539.382565 NaN BAA-1104045 \n", + "2024-02-14 08:22:26.412000179 23.412274 NaN BAA-1104047 \n", + "2024-02-14 08:23:13.721983910 23.219379 NaN BAA-1104047 \n", + "2024-02-14 08:23:57.768000126 25.565686 NaN BAA-1104047 \n", + "2024-02-14 08:24:20.101984024 21.508134 NaN BAA-1104045 \n", + "2024-02-14 08:24:40.705984116 684.281538 NaN BAA-1104047 \n", + "2024-02-14 08:26:23.029983997 691.446322 NaN BAA-1104045 \n", + "2024-02-14 08:29:16.335999966 23.449587 NaN BAA-1104047 \n", + "2024-02-14 08:34:36.980000019 392.475728 NaN BAA-1104045 \n", + "2024-02-14 08:35:02.955999851 680.256308 NaN BAA-1104045 \n", + "2024-02-14 08:42:52.768000126 23.423807 NaN BAA-1104047 \n", + "2024-02-14 08:43:12.713984013 384.997888 NaN BAA-1104045 \n", + "2024-02-14 08:45:27.196000099 751.062865 NaN BAA-1104047 \n", + "2024-02-14 08:45:37.736000061 450.582448 NaN BAA-1104045 \n", + "2024-02-14 08:46:39.004000186 555.656947 NaN BAA-1104045 \n", + "\n", + " dist_to_patch \n", + "time \n", + "2024-02-14 08:02:19.219999790 746.210657 \n", + "2024-02-14 08:02:43.841983795 749.594314 \n", + "2024-02-14 08:05:23.169983864 380.245593 \n", + "2024-02-14 08:11:36.375999928 633.403080 \n", + "2024-02-14 08:13:55.437983990 23.516178 \n", + "2024-02-14 08:14:07.480000019 23.583132 \n", + "2024-02-14 08:16:26.765984058 23.568197 \n", + "2024-02-14 08:19:22.361983776 562.156015 \n", + "2024-02-14 08:19:33.853983879 539.382565 \n", + "2024-02-14 08:22:26.412000179 23.412274 \n", + "2024-02-14 08:23:13.721983910 23.219379 \n", + "2024-02-14 08:23:57.768000126 25.565686 \n", + "2024-02-14 08:24:20.101984024 21.508134 \n", + "2024-02-14 08:24:40.705984116 684.281538 \n", + "2024-02-14 08:26:23.029983997 691.446322 \n", + "2024-02-14 08:29:16.335999966 23.449587 \n", + "2024-02-14 08:34:36.980000019 392.475728 \n", + "2024-02-14 08:35:02.955999851 680.256308 \n", + "2024-02-14 08:42:52.768000126 23.423807 \n", + "2024-02-14 08:43:12.713984013 384.997888 \n", + "2024-02-14 08:45:27.196000099 751.062865 \n", + "2024-02-14 08:45:37.736000061 450.582448 \n", + "2024-02-14 08:46:39.004000186 555.656947 " + ] + }, + "execution_count": 100, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dist_to_patch_pel_ts_subj" + ] + }, + { + "cell_type": "code", + "execution_count": 78, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[1259.26 , 536.5433 ],\n", + " [1269.9208 , 555.0077 ],\n", + " [1256.6609 , 536.35596],\n", + " ...,\n", + " [ 595.1556 , 368.43707],\n", + " [1299.1022 , 496.86774],\n", + " [ 595.17505, 368.38034]], dtype=float32)" + ] + }, + "execution_count": 78, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "subjects_xy = pose_df[pose_df[\"part\"] == \"centroid\"][[\"x\", \"y\"]].values\n", + "subjects_xy" + ] + }, + { + "cell_type": "code", + "execution_count": 79, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(110635, 2)" + ] + }, + "execution_count": 79, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "subjects_xy.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "metadata": {}, + "outputs": [], + "source": [ + "dist_to_patch = np.sqrt(np.sum((subjects_xy - patch_xy) ** 2, axis=1))\n", + "dist_to_patch_df = pose_df[[\"class\"]].copy()\n", + "dist_to_patch_df[\"dist_to_patch\"] = dist_to_patch" + ] + }, + { + "cell_type": "code", + "execution_count": 81, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
classdist_to_patch
time
2024-02-14 08:00:00.019999981BAA-1104045696.273687
2024-02-14 08:00:00.019999981BAA-1104047711.691849
2024-02-14 08:00:00.079999924BAA-1104045693.721146
2024-02-14 08:00:00.079999924BAA-1104045713.902905
2024-02-14 08:00:00.139999866BAA-1104045694.602667
.........
2024-02-14 08:59:59.840000153BAA-110404521.412034
2024-02-14 08:59:59.840000153BAA-1104045725.975112
2024-02-14 08:59:59.900000095BAA-110404521.343971
2024-02-14 08:59:59.900000095BAA-1104047725.538902
2024-02-14 08:59:59.960000038BAA-110404721.295293
\n", + "

110635 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " class dist_to_patch\n", + "time \n", + "2024-02-14 08:00:00.019999981 BAA-1104045 696.273687\n", + "2024-02-14 08:00:00.019999981 BAA-1104047 711.691849\n", + "2024-02-14 08:00:00.079999924 BAA-1104045 693.721146\n", + "2024-02-14 08:00:00.079999924 BAA-1104045 713.902905\n", + "2024-02-14 08:00:00.139999866 BAA-1104045 694.602667\n", + "... ... ...\n", + "2024-02-14 08:59:59.840000153 BAA-1104045 21.412034\n", + "2024-02-14 08:59:59.840000153 BAA-1104045 725.975112\n", + "2024-02-14 08:59:59.900000095 BAA-1104045 21.343971\n", + "2024-02-14 08:59:59.900000095 BAA-1104047 725.538902\n", + "2024-02-14 08:59:59.960000038 BAA-1104047 21.295293\n", + "\n", + "[110635 rows x 2 columns]" + ] + }, + "execution_count": 81, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dist_to_patch_df" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BAA-1104045
time
2024-01-31 17:46:01.92998409319.174071
2024-01-31 17:46:18.98799991615.551528
2024-01-31 17:46:37.32399988219.905172
2024-01-31 17:46:52.65798378019.984235
2024-01-31 17:47:07.56198406221.056611
2024-01-31 17:47:18.12799978317.622595
2024-01-31 17:47:29.80800008819.765585
2024-01-31 17:47:44.27398395517.342467
2024-01-31 17:47:58.58198404321.922041
2024-01-31 17:48:20.59999990518.808438
2024-01-31 17:48:34.61398410820.958044
2024-01-31 17:49:30.23600006121.401976
2024-01-31 17:53:13.27199983619.659521
2024-01-31 17:53:39.99398422221.454221
2024-01-31 17:53:55.45200014122.236733
\n", + "
" + ], + "text/plain": [ + " BAA-1104045\n", + "time \n", + "2024-01-31 17:46:01.929984093 19.174071\n", + "2024-01-31 17:46:18.987999916 15.551528\n", + "2024-01-31 17:46:37.323999882 19.905172\n", + "2024-01-31 17:46:52.657983780 19.984235\n", + "2024-01-31 17:47:07.561984062 21.056611\n", + "2024-01-31 17:47:18.127999783 17.622595\n", + "2024-01-31 17:47:29.808000088 19.765585\n", + "2024-01-31 17:47:44.273983955 17.342467\n", + "2024-01-31 17:47:58.581984043 21.922041\n", + "2024-01-31 17:48:20.599999905 18.808438\n", + "2024-01-31 17:48:34.613984108 20.958044\n", + "2024-01-31 17:49:30.236000061 21.401976\n", + "2024-01-31 17:53:13.271999836 19.659521\n", + "2024-01-31 17:53:39.993984222 21.454221\n", + "2024-01-31 17:53:55.452000141 22.236733" + ] + }, + "execution_count": 83, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dist_to_patch_id_df" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
timethresholdpatchid
02024-01-31 17:46:01.929984093166.161345Patch3BAA-1104045
12024-01-31 17:46:18.987999916201.563446Patch3BAA-1104045
22024-01-31 17:46:37.323999882148.860696Patch3BAA-1104045
32024-01-31 17:46:52.657983780155.151245Patch3BAA-1104045
42024-01-31 17:47:07.56198406285.592153Patch3BAA-1104045
52024-01-31 17:47:18.127999783132.567869Patch3BAA-1104045
62024-01-31 17:47:29.808000088148.151722Patch3BAA-1104045
72024-01-31 17:47:44.273983955118.466936Patch3BAA-1104045
82024-01-31 17:47:58.581984043104.584493Patch3BAA-1104045
92024-01-31 17:48:20.59999990588.933069Patch3BAA-1104045
102024-01-31 17:48:34.613984108405.436991Patch3BAA-1104045
112024-01-31 17:49:30.236000061194.962748Patch3BAA-1104045
122024-01-31 17:53:13.271999836156.343961Patch3BAA-1104045
132024-01-31 17:53:39.99398422290.257312Patch3BAA-1104045
142024-01-31 17:53:55.45200014182.164552Patch3BAA-1104045
\n", + "
" + ], + "text/plain": [ + " time threshold patch id\n", + "0 2024-01-31 17:46:01.929984093 166.161345 Patch3 BAA-1104045\n", + "1 2024-01-31 17:46:18.987999916 201.563446 Patch3 BAA-1104045\n", + "2 2024-01-31 17:46:37.323999882 148.860696 Patch3 BAA-1104045\n", + "3 2024-01-31 17:46:52.657983780 155.151245 Patch3 BAA-1104045\n", + "4 2024-01-31 17:47:07.561984062 85.592153 Patch3 BAA-1104045\n", + "5 2024-01-31 17:47:18.127999783 132.567869 Patch3 BAA-1104045\n", + "6 2024-01-31 17:47:29.808000088 148.151722 Patch3 BAA-1104045\n", + "7 2024-01-31 17:47:44.273983955 118.466936 Patch3 BAA-1104045\n", + "8 2024-01-31 17:47:58.581984043 104.584493 Patch3 BAA-1104045\n", + "9 2024-01-31 17:48:20.599999905 88.933069 Patch3 BAA-1104045\n", + "10 2024-01-31 17:48:34.613984108 405.436991 Patch3 BAA-1104045\n", + "11 2024-01-31 17:49:30.236000061 194.962748 Patch3 BAA-1104045\n", + "12 2024-01-31 17:53:13.271999836 156.343961 Patch3 BAA-1104045\n", + "13 2024-01-31 17:53:39.993984222 90.257312 Patch3 BAA-1104045\n", + "14 2024-01-31 17:53:55.452000141 82.164552 Patch3 BAA-1104045" + ] + }, + "execution_count": 69, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "patch_df_for_pellets_df" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BAA-1104045
time
2024-01-31 17:46:01.92998409319.174071
2024-01-31 17:46:18.98799991615.551528
2024-01-31 17:46:37.32399988219.905172
2024-01-31 17:46:52.65798378019.984235
2024-01-31 17:47:07.56198406221.056611
2024-01-31 17:47:18.12799978317.622595
2024-01-31 17:47:29.80800008819.765585
2024-01-31 17:47:44.27398395517.342467
2024-01-31 17:47:58.58198404321.922041
2024-01-31 17:48:20.59999990518.808438
2024-01-31 17:48:34.61398410820.958044
2024-01-31 17:49:30.23600006121.401976
2024-01-31 17:53:13.27199983619.659521
2024-01-31 17:53:39.99398422221.454221
2024-01-31 17:53:55.45200014122.236733
\n", + "
" + ], + "text/plain": [ + " BAA-1104045\n", + "time \n", + "2024-01-31 17:46:01.929984093 19.174071\n", + "2024-01-31 17:46:18.987999916 15.551528\n", + "2024-01-31 17:46:37.323999882 19.905172\n", + "2024-01-31 17:46:52.657983780 19.984235\n", + "2024-01-31 17:47:07.561984062 21.056611\n", + "2024-01-31 17:47:18.127999783 17.622595\n", + "2024-01-31 17:47:29.808000088 19.765585\n", + "2024-01-31 17:47:44.273983955 17.342467\n", + "2024-01-31 17:47:58.581984043 21.922041\n", + "2024-01-31 17:48:20.599999905 18.808438\n", + "2024-01-31 17:48:34.613984108 20.958044\n", + "2024-01-31 17:49:30.236000061 21.401976\n", + "2024-01-31 17:53:13.271999836 19.659521\n", + "2024-01-31 17:53:39.993984222 21.454221\n", + "2024-01-31 17:53:55.452000141 22.236733" + ] + }, + "execution_count": 68, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dist_to_patch_id_df" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'BAA-1104045': {'Patch1': array([-0.00000000e+00, -3.06814884e-03, -1.53407442e-03, ...,\n", + " 3.28233171e+03, 3.28233631e+03, 3.28232864e+03]),\n", + " 'Patch2': array([-0.00000000e+00, 1.53407442e-03, 4.60222326e-03, ...,\n", + " 5.53662799e+01, 5.53662799e+01, 5.53708821e+01]),\n", + " 'Patch3': array([-0.00000000e+00, -1.53407442e-03, -1.53407442e-03, ...,\n", + " 2.38928409e+03, 2.38928256e+03, 2.38927796e+03])},\n", + " '_ipython_display_': {},\n", + " '_repr_html_': {},\n", + " '_repr_javascript_': {},\n", + " '_repr_jpeg_': {},\n", + " '_repr_json_': {},\n", + " '_repr_latex_': {},\n", + " '_repr_markdown_': {},\n", + " '_repr_mimebundle_': {},\n", + " '_repr_pdf_': {},\n", + " '_repr_png_': {},\n", + " '_repr_svg_': {},\n", + " 'time': DatetimeIndex(['2024-01-31 16:18:07.001984119',\n", + " '2024-01-31 16:18:07.101984024',\n", + " '2024-01-31 16:18:07.201983929',\n", + " '2024-01-31 16:18:07.301983833',\n", + " '2024-01-31 16:18:07.401984215',\n", + " '2024-01-31 16:18:07.501984118',\n", + " '2024-01-31 16:18:07.601984024',\n", + " '2024-01-31 16:18:07.701983929',\n", + " '2024-01-31 16:18:07.801983833',\n", + " '2024-01-31 16:18:07.901984215',\n", + " ...\n", + " '2024-01-31 17:56:22.001984119',\n", + " '2024-01-31 17:56:22.101984024',\n", + " '2024-01-31 17:56:22.201983929',\n", + " '2024-01-31 17:56:22.301983833',\n", + " '2024-01-31 17:56:22.401984215',\n", + " '2024-01-31 17:56:22.501984118',\n", + " '2024-01-31 17:56:22.601984024',\n", + " '2024-01-31 17:56:22.701983929',\n", + " '2024-01-31 17:56:22.801983833',\n", + " '2024-01-31 17:56:22.901984215'],\n", + " dtype='datetime64[ns]', name='time', length=58960, freq=None)}\n" + ] + } + ], + "source": [ + "block.cum_wheel_dist.pprint()\n" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "14.142135623730951" + ] + }, + "execution_count": 60, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "np.sqrt(np.sum((patch_xy - (patch_xy + 10))**2))" + ] + }, + { + "cell_type": "code", + "execution_count": 212, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
xy
time
2024-01-31 16:18:07.059999943922.973083538.867432
2024-01-31 16:18:07.119999886923.023926538.851929
2024-01-31 16:18:07.179999828923.019226538.852417
2024-01-31 16:18:07.239999771922.998718538.848206
2024-01-31 16:18:07.300000191923.012939538.838379
.........
2024-01-31 17:56:22.6599998471109.742920872.181152
2024-01-31 17:56:22.7199997901104.848389875.274902
2024-01-31 17:56:22.7800002101096.728882885.990417
2024-01-31 17:56:22.8400001531086.006714896.699646
2024-01-31 17:56:22.9000000951075.127197910.000854
\n", + "

98177 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " x y\n", + "time \n", + "2024-01-31 16:18:07.059999943 922.973083 538.867432\n", + "2024-01-31 16:18:07.119999886 923.023926 538.851929\n", + "2024-01-31 16:18:07.179999828 923.019226 538.852417\n", + "2024-01-31 16:18:07.239999771 922.998718 538.848206\n", + "2024-01-31 16:18:07.300000191 923.012939 538.838379\n", + "... ... ...\n", + "2024-01-31 17:56:22.659999847 1109.742920 872.181152\n", + "2024-01-31 17:56:22.719999790 1104.848389 875.274902\n", + "2024-01-31 17:56:22.780000210 1096.728882 885.990417\n", + "2024-01-31 17:56:22.840000153 1086.006714 896.699646\n", + "2024-01-31 17:56:22.900000095 1075.127197 910.000854\n", + "\n", + "[98177 rows x 2 columns]" + ] + }, + "execution_count": 212, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Get part = centroid, return x,y as np.array\n", + "pose_df[pose_df[\"part\"] == \"centroid\"][[\"x\", \"y\"]]" + ] + }, + { + "cell_type": "code", + "execution_count": 221, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
timethresholdpatchid
02024-01-31 17:46:01.929984093166.161345Patch3BAA-1104045
12024-01-31 17:46:18.987999916201.563446Patch3BAA-1104045
22024-01-31 17:46:37.323999882148.860696Patch3BAA-1104045
32024-01-31 17:46:52.657983780155.151245Patch3BAA-1104045
42024-01-31 17:47:07.56198406285.592153Patch3BAA-1104045
52024-01-31 17:47:18.127999783132.567869Patch3BAA-1104045
62024-01-31 17:47:29.808000088148.151722Patch3BAA-1104045
72024-01-31 17:47:44.273983955118.466936Patch3BAA-1104045
82024-01-31 17:47:58.581984043104.584493Patch3BAA-1104045
92024-01-31 17:48:20.59999990588.933069Patch3BAA-1104045
102024-01-31 17:48:34.613984108405.436991Patch3BAA-1104045
112024-01-31 17:49:30.236000061194.962748Patch3BAA-1104045
122024-01-31 17:53:13.271999836156.343961Patch3BAA-1104045
132024-01-31 17:53:39.99398422290.257312Patch3BAA-1104045
142024-01-31 17:53:55.45200014182.164552Patch3BAA-1104045
\n", + "
" + ], + "text/plain": [ + " time threshold patch id\n", + "0 2024-01-31 17:46:01.929984093 166.161345 Patch3 BAA-1104045\n", + "1 2024-01-31 17:46:18.987999916 201.563446 Patch3 BAA-1104045\n", + "2 2024-01-31 17:46:37.323999882 148.860696 Patch3 BAA-1104045\n", + "3 2024-01-31 17:46:52.657983780 155.151245 Patch3 BAA-1104045\n", + "4 2024-01-31 17:47:07.561984062 85.592153 Patch3 BAA-1104045\n", + "5 2024-01-31 17:47:18.127999783 132.567869 Patch3 BAA-1104045\n", + "6 2024-01-31 17:47:29.808000088 148.151722 Patch3 BAA-1104045\n", + "7 2024-01-31 17:47:44.273983955 118.466936 Patch3 BAA-1104045\n", + "8 2024-01-31 17:47:58.581984043 104.584493 Patch3 BAA-1104045\n", + "9 2024-01-31 17:48:20.599999905 88.933069 Patch3 BAA-1104045\n", + "10 2024-01-31 17:48:34.613984108 405.436991 Patch3 BAA-1104045\n", + "11 2024-01-31 17:49:30.236000061 194.962748 Patch3 BAA-1104045\n", + "12 2024-01-31 17:53:13.271999836 156.343961 Patch3 BAA-1104045\n", + "13 2024-01-31 17:53:39.993984222 90.257312 Patch3 BAA-1104045\n", + "14 2024-01-31 17:53:55.452000141 82.164552 Patch3 BAA-1104045" + ] + }, + "execution_count": 221, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "patch_df_for_pellets_df" + ] + }, + { + "cell_type": "code", + "execution_count": 223, + "metadata": {}, + "outputs": [], + "source": [ + "dist_to_patch_id_df = pd.DataFrame(index=patch_df_for_pellets_df[\"time\"], columns=[subjects])" + ] + }, + { + "cell_type": "code", + "execution_count": 224, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BAA-1104045
time
2024-01-31 17:46:01.929984093NaN
2024-01-31 17:46:18.987999916NaN
2024-01-31 17:46:37.323999882NaN
2024-01-31 17:46:52.657983780NaN
2024-01-31 17:47:07.561984062NaN
2024-01-31 17:47:18.127999783NaN
2024-01-31 17:47:29.808000088NaN
2024-01-31 17:47:44.273983955NaN
2024-01-31 17:47:58.581984043NaN
2024-01-31 17:48:20.599999905NaN
2024-01-31 17:48:34.613984108NaN
2024-01-31 17:49:30.236000061NaN
2024-01-31 17:53:13.271999836NaN
2024-01-31 17:53:39.993984222NaN
2024-01-31 17:53:55.452000141NaN
\n", + "
" + ], + "text/plain": [ + " BAA-1104045\n", + "time \n", + "2024-01-31 17:46:01.929984093 NaN\n", + "2024-01-31 17:46:18.987999916 NaN\n", + "2024-01-31 17:46:37.323999882 NaN\n", + "2024-01-31 17:46:52.657983780 NaN\n", + "2024-01-31 17:47:07.561984062 NaN\n", + "2024-01-31 17:47:18.127999783 NaN\n", + "2024-01-31 17:47:29.808000088 NaN\n", + "2024-01-31 17:47:44.273983955 NaN\n", + "2024-01-31 17:47:58.581984043 NaN\n", + "2024-01-31 17:48:20.599999905 NaN\n", + "2024-01-31 17:48:34.613984108 NaN\n", + "2024-01-31 17:49:30.236000061 NaN\n", + "2024-01-31 17:53:13.271999836 NaN\n", + "2024-01-31 17:53:39.993984222 NaN\n", + "2024-01-31 17:53:55.452000141 NaN" + ] + }, + "execution_count": 224, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dist_to_patch_id_df" + ] + }, + { + "cell_type": "code", + "execution_count": 231, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
classdist_to_patch
time
2024-01-31 16:18:07.059999943BAA-1104045384.666605
2024-01-31 16:18:07.119999886BAA-1104045384.703057
2024-01-31 16:18:07.179999828BAA-1104045384.699218
2024-01-31 16:18:07.239999771BAA-1104045384.679323
2024-01-31 16:18:07.300000191BAA-1104045384.686795
.........
2024-01-31 17:56:22.659999847BAA-1104045738.876897
2024-01-31 17:56:22.719999790BAA-1104045737.643805
2024-01-31 17:56:22.780000210BAA-1104045739.744758
2024-01-31 17:56:22.840000153BAA-1104045740.328964
2024-01-31 17:56:22.900000095BAA-1104045743.077797
\n", + "

98177 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " class dist_to_patch\n", + "time \n", + "2024-01-31 16:18:07.059999943 BAA-1104045 384.666605\n", + "2024-01-31 16:18:07.119999886 BAA-1104045 384.703057\n", + "2024-01-31 16:18:07.179999828 BAA-1104045 384.699218\n", + "2024-01-31 16:18:07.239999771 BAA-1104045 384.679323\n", + "2024-01-31 16:18:07.300000191 BAA-1104045 384.686795\n", + "... ... ...\n", + "2024-01-31 17:56:22.659999847 BAA-1104045 738.876897\n", + "2024-01-31 17:56:22.719999790 BAA-1104045 737.643805\n", + "2024-01-31 17:56:22.780000210 BAA-1104045 739.744758\n", + "2024-01-31 17:56:22.840000153 BAA-1104045 740.328964\n", + "2024-01-31 17:56:22.900000095 BAA-1104045 743.077797\n", + "\n", + "[98177 rows x 2 columns]" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BAA-1104045
time
2024-01-31 17:46:01.929984093NaN
2024-01-31 17:46:18.987999916NaN
2024-01-31 17:46:37.323999882NaN
2024-01-31 17:46:52.657983780NaN
2024-01-31 17:47:07.561984062NaN
2024-01-31 17:47:18.127999783NaN
2024-01-31 17:47:29.808000088NaN
2024-01-31 17:47:44.273983955NaN
2024-01-31 17:47:58.581984043NaN
2024-01-31 17:48:20.599999905NaN
2024-01-31 17:48:34.613984108NaN
2024-01-31 17:49:30.236000061NaN
2024-01-31 17:53:13.271999836NaN
2024-01-31 17:53:39.993984222NaN
2024-01-31 17:53:55.452000141NaN
\n", + "
" + ], + "text/plain": [ + " BAA-1104045\n", + "time \n", + "2024-01-31 17:46:01.929984093 NaN\n", + "2024-01-31 17:46:18.987999916 NaN\n", + "2024-01-31 17:46:37.323999882 NaN\n", + "2024-01-31 17:46:52.657983780 NaN\n", + "2024-01-31 17:47:07.561984062 NaN\n", + "2024-01-31 17:47:18.127999783 NaN\n", + "2024-01-31 17:47:29.808000088 NaN\n", + "2024-01-31 17:47:44.273983955 NaN\n", + "2024-01-31 17:47:58.581984043 NaN\n", + "2024-01-31 17:48:20.599999905 NaN\n", + "2024-01-31 17:48:34.613984108 NaN\n", + "2024-01-31 17:49:30.236000061 NaN\n", + "2024-01-31 17:53:13.271999836 NaN\n", + "2024-01-31 17:53:39.993984222 NaN\n", + "2024-01-31 17:53:55.452000141 NaN" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "patch_xy = np.array(patch_locs[patch][arena]).astype(np.uint32)\n", + "subjects_xy = pose_df[pose_df[\"part\"] == \"centroid\"][[\"x\", \"y\"]].values\n", + "dist_to_patch = np.sqrt(np.sum((subjects_xy - patch_xy) ** 2, axis=1))\n", + "dist_to_patch_df = pose_df[[\"class\"]].copy()\n", + "dist_to_patch_df[\"dist_to_patch\"] = dist_to_patch\n", + "dist_to_patch_id_df = pd.DataFrame(index=patch_df_for_pellets_df[\"time\"], columns=[subjects])\n", + "display(dist_to_patch_df)\n", + "display(dist_to_patch_id_df)" + ] + }, + { + "cell_type": "code", + "execution_count": 238, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
(BAA-1104045,)classdist_to_patch
time
2024-01-31 17:46:01.929984093NaNBAA-110404519.174071
2024-01-31 17:46:18.987999916NaNBAA-110404515.551528
2024-01-31 17:46:37.323999882NaNBAA-110404519.905172
2024-01-31 17:46:52.657983780NaNBAA-110404519.984235
2024-01-31 17:47:07.561984062NaNBAA-110404521.056611
2024-01-31 17:47:18.127999783NaNBAA-110404517.622595
2024-01-31 17:47:29.808000088NaNBAA-110404519.765585
2024-01-31 17:47:44.273983955NaNBAA-110404517.342467
2024-01-31 17:47:58.581984043NaNBAA-110404521.922041
2024-01-31 17:48:20.599999905NaNBAA-110404518.808438
2024-01-31 17:48:34.613984108NaNBAA-110404520.958044
2024-01-31 17:49:30.236000061NaNBAA-110404521.401976
2024-01-31 17:53:13.271999836NaNBAA-110404519.659521
2024-01-31 17:53:39.993984222NaNBAA-110404521.454221
2024-01-31 17:53:55.452000141NaNBAA-110404522.236733
\n", + "
" + ], + "text/plain": [ + " (BAA-1104045,) class dist_to_patch\n", + "time \n", + "2024-01-31 17:46:01.929984093 NaN BAA-1104045 19.174071\n", + "2024-01-31 17:46:18.987999916 NaN BAA-1104045 15.551528\n", + "2024-01-31 17:46:37.323999882 NaN BAA-1104045 19.905172\n", + "2024-01-31 17:46:52.657983780 NaN BAA-1104045 19.984235\n", + "2024-01-31 17:47:07.561984062 NaN BAA-1104045 21.056611\n", + "2024-01-31 17:47:18.127999783 NaN BAA-1104045 17.622595\n", + "2024-01-31 17:47:29.808000088 NaN BAA-1104045 19.765585\n", + "2024-01-31 17:47:44.273983955 NaN BAA-1104045 17.342467\n", + "2024-01-31 17:47:58.581984043 NaN BAA-1104045 21.922041\n", + "2024-01-31 17:48:20.599999905 NaN BAA-1104045 18.808438\n", + "2024-01-31 17:48:34.613984108 NaN BAA-1104045 20.958044\n", + "2024-01-31 17:49:30.236000061 NaN BAA-1104045 21.401976\n", + "2024-01-31 17:53:13.271999836 NaN BAA-1104045 19.659521\n", + "2024-01-31 17:53:39.993984222 NaN BAA-1104045 21.454221\n", + "2024-01-31 17:53:55.452000141 NaN BAA-1104045 22.236733" + ] + }, + "execution_count": 238, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pd.merge_asof(dist_to_patch_id_df, dist_to_patch_df, left_index=True, right_index=True, direction=\"forward\", tolerance=pd.Timedelta(\"200ms\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 240, + "metadata": {}, + "outputs": [], + "source": [ + " patch_xy = np.array(patch_locs[patch][arena]).astype(np.uint32)\n", + " subjects_xy = pose_df[pose_df[\"part\"] == \"centroid\"][[\"x\", \"y\"]].values\n", + " dist_to_patch = np.sqrt(np.sum((subjects_xy - patch_xy) ** 2, axis=1))\n", + " dist_to_patch_df = pose_df[[\"class\"]].copy()\n", + " dist_to_patch_df[\"dist_to_patch\"] = dist_to_patch\n", + " dist_to_patch_id_df = pd.DataFrame(index=patch_df_for_pellets_df[\"time\"], columns=subjects)\n", + " for subject in subjects:\n", + " # Find closest match between dist_to_patch_id_df indices and pose_df indices\n", + " dist_to_patch_subj = pd.merge_asof(\n", + " left=dist_to_patch_id_df, \n", + " right=dist_to_patch_df,\n", + " left_index=True,\n", + " right_index=True, \n", + " direction=\"forward\", \n", + " tolerance=pd.Timedelta(\"200ms\")\n", + " )\n", + " dist_to_patch_id_df[subject] = dist_to_patch_subj[\"dist_to_patch\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 248, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
BAA-1104045BAA-1104047
time
2024-01-31 17:46:01.92998409319.17407120.174071
2024-01-31 17:46:18.98799991615.55152814.551528
2024-01-31 17:46:37.32399988219.90517220.905172
2024-01-31 17:46:52.65798378019.98423518.984235
2024-01-31 17:47:07.56198406221.05661122.056611
2024-01-31 17:47:18.12799978317.62259516.622595
2024-01-31 17:47:29.80800008819.76558520.765585
2024-01-31 17:47:44.27398395517.34246716.342467
2024-01-31 17:47:58.58198404321.92204122.922041
2024-01-31 17:48:20.59999990518.80843817.808438
2024-01-31 17:48:34.61398410820.95804421.958044
2024-01-31 17:49:30.23600006121.40197620.401976
2024-01-31 17:53:13.27199983619.65952120.659521
2024-01-31 17:53:39.99398422221.45422120.454221
2024-01-31 17:53:55.45200014122.23673323.236733
\n", + "
" + ], + "text/plain": [ + " BAA-1104045 BAA-1104047\n", + "time \n", + "2024-01-31 17:46:01.929984093 19.174071 20.174071\n", + "2024-01-31 17:46:18.987999916 15.551528 14.551528\n", + "2024-01-31 17:46:37.323999882 19.905172 20.905172\n", + "2024-01-31 17:46:52.657983780 19.984235 18.984235\n", + "2024-01-31 17:47:07.561984062 21.056611 22.056611\n", + "2024-01-31 17:47:18.127999783 17.622595 16.622595\n", + "2024-01-31 17:47:29.808000088 19.765585 20.765585\n", + "2024-01-31 17:47:44.273983955 17.342467 16.342467\n", + "2024-01-31 17:47:58.581984043 21.922041 22.922041\n", + "2024-01-31 17:48:20.599999905 18.808438 17.808438\n", + "2024-01-31 17:48:34.613984108 20.958044 21.958044\n", + "2024-01-31 17:49:30.236000061 21.401976 20.401976\n", + "2024-01-31 17:53:13.271999836 19.659521 20.659521\n", + "2024-01-31 17:53:39.993984222 21.454221 20.454221\n", + "2024-01-31 17:53:55.452000141 22.236733 23.236733" + ] + }, + "execution_count": 248, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dist_to_patch_id_df[\"BAA-1104047\"] = dist_to_patch_id_df[\"BAA-1104045\"]\n", + "dist_to_patch_id_df[\"BAA-1104047\"] -= 1\n", + "dist_to_patch_id_df[\"BAA-1104047\"].iloc[::2] += 2\n", + "dist_to_patch_id_df" + ] + }, + { + "cell_type": "code", + "execution_count": 251, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array(['BAA-1104045', 'BAA-1104047', 'BAA-1104045', 'BAA-1104047',\n", + " 'BAA-1104045', 'BAA-1104047', 'BAA-1104045', 'BAA-1104047',\n", + " 'BAA-1104045', 'BAA-1104047', 'BAA-1104045', 'BAA-1104047',\n", + " 'BAA-1104045', 'BAA-1104047', 'BAA-1104045'], dtype=object)" + ] + }, + "execution_count": 251, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dist_to_patch_id_df.idxmin(axis=1).values" + ] + }, + { + "cell_type": "code", + "execution_count": 252, + "metadata": {}, + "outputs": [], + "source": [ + "patch_df_for_pellets_df[\"id\"] = dist_to_patch_id_df.idxmin(axis=1).values" + ] + }, + { + "cell_type": "code", + "execution_count": 253, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
timethresholdpatchid
02024-01-31 17:46:01.929984093166.161345Patch3BAA-1104045
12024-01-31 17:46:18.987999916201.563446Patch3BAA-1104047
22024-01-31 17:46:37.323999882148.860696Patch3BAA-1104045
32024-01-31 17:46:52.657983780155.151245Patch3BAA-1104047
42024-01-31 17:47:07.56198406285.592153Patch3BAA-1104045
52024-01-31 17:47:18.127999783132.567869Patch3BAA-1104047
62024-01-31 17:47:29.808000088148.151722Patch3BAA-1104045
72024-01-31 17:47:44.273983955118.466936Patch3BAA-1104047
82024-01-31 17:47:58.581984043104.584493Patch3BAA-1104045
92024-01-31 17:48:20.59999990588.933069Patch3BAA-1104047
102024-01-31 17:48:34.613984108405.436991Patch3BAA-1104045
112024-01-31 17:49:30.236000061194.962748Patch3BAA-1104047
122024-01-31 17:53:13.271999836156.343961Patch3BAA-1104045
132024-01-31 17:53:39.99398422290.257312Patch3BAA-1104047
142024-01-31 17:53:55.45200014182.164552Patch3BAA-1104045
\n", + "
" + ], + "text/plain": [ + " time threshold patch id\n", + "0 2024-01-31 17:46:01.929984093 166.161345 Patch3 BAA-1104045\n", + "1 2024-01-31 17:46:18.987999916 201.563446 Patch3 BAA-1104047\n", + "2 2024-01-31 17:46:37.323999882 148.860696 Patch3 BAA-1104045\n", + "3 2024-01-31 17:46:52.657983780 155.151245 Patch3 BAA-1104047\n", + "4 2024-01-31 17:47:07.561984062 85.592153 Patch3 BAA-1104045\n", + "5 2024-01-31 17:47:18.127999783 132.567869 Patch3 BAA-1104047\n", + "6 2024-01-31 17:47:29.808000088 148.151722 Patch3 BAA-1104045\n", + "7 2024-01-31 17:47:44.273983955 118.466936 Patch3 BAA-1104047\n", + "8 2024-01-31 17:47:58.581984043 104.584493 Patch3 BAA-1104045\n", + "9 2024-01-31 17:48:20.599999905 88.933069 Patch3 BAA-1104047\n", + "10 2024-01-31 17:48:34.613984108 405.436991 Patch3 BAA-1104045\n", + "11 2024-01-31 17:49:30.236000061 194.962748 Patch3 BAA-1104047\n", + "12 2024-01-31 17:53:13.271999836 156.343961 Patch3 BAA-1104045\n", + "13 2024-01-31 17:53:39.993984222 90.257312 Patch3 BAA-1104047\n", + "14 2024-01-31 17:53:55.452000141 82.164552 Patch3 BAA-1104045" + ] + }, + "execution_count": 253, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "patch_df_for_pellets_df" + ] + }, + { + "cell_type": "code", + "execution_count": 166, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
thresholdoffsetrate
time
2024-02-14 08:02:06.921984196115.006748750.01
2024-02-14 08:02:19.219999790361.785049750.01
2024-02-14 08:02:43.841983795194.950509750.01
2024-02-14 08:05:23.16998386488.046672750.01
2024-02-14 08:11:36.37599992885.945754750.01
2024-02-14 08:13:55.43798399076.270649750.01
2024-02-14 08:14:07.480000019205.543520750.01
2024-02-14 08:16:26.76598405888.423802750.01
2024-02-14 08:19:22.36198377696.462577750.01
2024-02-14 08:19:33.853983879132.625352750.01
2024-02-14 08:22:26.412000179372.380471750.01
2024-02-14 08:23:13.72198391088.550613750.01
2024-02-14 08:23:57.768000126158.293375750.01
2024-02-14 08:24:20.10198402494.946606750.01
2024-02-14 08:24:40.705984116128.350386750.01
2024-02-14 08:26:23.029983997103.003226750.01
2024-02-14 08:29:16.335999966439.736339750.01
2024-02-14 08:34:36.980000019241.119074750.01
2024-02-14 08:35:02.955999851209.483334750.01
2024-02-14 08:42:52.768000126169.083744750.01
2024-02-14 08:43:12.713984013146.062839750.01
2024-02-14 08:45:27.19600009988.638738750.01
2024-02-14 08:45:37.73600006180.205599750.01
2024-02-14 08:46:39.001984119NaN750.01
2024-02-14 08:46:39.004000186NaN750.01
2024-02-14 08:46:39.004000186205.907633750.01
\n", + "
" + ], + "text/plain": [ + " threshold offset rate\n", + "time \n", + "2024-02-14 08:02:06.921984196 115.006748 75 0.01\n", + "2024-02-14 08:02:19.219999790 361.785049 75 0.01\n", + "2024-02-14 08:02:43.841983795 194.950509 75 0.01\n", + "2024-02-14 08:05:23.169983864 88.046672 75 0.01\n", + "2024-02-14 08:11:36.375999928 85.945754 75 0.01\n", + "2024-02-14 08:13:55.437983990 76.270649 75 0.01\n", + "2024-02-14 08:14:07.480000019 205.543520 75 0.01\n", + "2024-02-14 08:16:26.765984058 88.423802 75 0.01\n", + "2024-02-14 08:19:22.361983776 96.462577 75 0.01\n", + "2024-02-14 08:19:33.853983879 132.625352 75 0.01\n", + "2024-02-14 08:22:26.412000179 372.380471 75 0.01\n", + "2024-02-14 08:23:13.721983910 88.550613 75 0.01\n", + "2024-02-14 08:23:57.768000126 158.293375 75 0.01\n", + "2024-02-14 08:24:20.101984024 94.946606 75 0.01\n", + "2024-02-14 08:24:40.705984116 128.350386 75 0.01\n", + "2024-02-14 08:26:23.029983997 103.003226 75 0.01\n", + "2024-02-14 08:29:16.335999966 439.736339 75 0.01\n", + "2024-02-14 08:34:36.980000019 241.119074 75 0.01\n", + "2024-02-14 08:35:02.955999851 209.483334 75 0.01\n", + "2024-02-14 08:42:52.768000126 169.083744 75 0.01\n", + "2024-02-14 08:43:12.713984013 146.062839 75 0.01\n", + "2024-02-14 08:45:27.196000099 88.638738 75 0.01\n", + "2024-02-14 08:45:37.736000061 80.205599 75 0.01\n", + "2024-02-14 08:46:39.001984119 NaN 75 0.01\n", + "2024-02-14 08:46:39.004000186 NaN 75 0.01\n", + "2024-02-14 08:46:39.004000186 205.907633 75 0.01" + ] + }, + "execution_count": 166, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "patch_df" + ] + }, + { + "cell_type": "code", + "execution_count": 167, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "23" + ] + }, + "execution_count": 167, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sum(np.diff(patch_df.index) > pd.Timedelta(\"1s\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 218, + "metadata": {}, + "outputs": [], + "source": [ + " patch_xy = np.array(patch_locs[patch][arena]).astype(np.uint32)\n", + " subjects_xy = pose_df[pose_df[\"part\"] == \"centroid\"][[\"x\", \"y\"]].values\n", + " dist_to_patch = np.sqrt(np.sum((subjects_xy - patch_xy) ** 2, axis=1))" + ] + }, + { + "cell_type": "code", + "execution_count": 219, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([384.66660495, 384.70305651, 384.69921817, ..., 739.74475784,\n", + " 740.32896414, 743.07779698])" + ] + }, + "execution_count": 219, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dist_to_patch" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "np.convolve([1, 2, 3, 4, 5], [1, 1, 1])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# NOPE" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# wboth_quantized[i]].index[0] - pd.Timedelta(\"1s\")\n", + " if (epoch_ts_post > safe_change_ts) and not epoch_thresh_change_idx:\n", + " epoch_thresh_change_idx = i\n", + " weasy_post = weasy[weasy.index > epoch_ts_post][0]\n", + " whard_post = whard[whard.index > epoch_ts_post][0]\n", + " weasy_pre = weasy[weasy.index > epoch_ts_pre][0]\n", + " whard_pre = whard[whard.index > epoch_ts_pre][0]\n", + " weasy_diff = weasy_post - weasy_pre\n", + " whard_diff = whard_post - whard_pre\n", + " easy_pref_epoch_cum[i] = weasy_post / (weasy_post + whard_post)\n", + " easy_pref_epoch[i] = weasy_diff / (weasy_diff + whard_diff)\n", + " epoch_ts_pre = epoch_ts_post\n", + "sessions.at[s.Index, \"easy_pref_epoch_cum\"] = easy_pref_epoch_cum\n", + "sessions.at[s.Index, \"easy_pref_epoch\"] = easy_pref_epoch\n", + "sessions.loc[s.Index, \"epoch_thresh_change_idx\"] = epoch_thresh_change_idx\n", + "# /ss>\n", + "# w_chunk_dist)[0][0]\n", + "end_idxs = np.arange(pref_first_idx, n_samples, 1).astype(int)\n", + "start_idxs = np.zeros((len(end_idxs),)).astype(int)\n", + "for i, idx in enumerate(end_idxs):\n", + " start_idxs[i] = np.where((w_all_chnkd_cumsum[0:idx] + w_chunk_dist) > w_all_chnkd_cumsum[idx])[0][0]\n", + "# /sss>\n", + "# \n", + "# 0.1, whard_chnkd_gen > 0.1))[0]\n", + " for ii in impossible_idxs:\n", + " if weasy_chnkd_gen[ii] > whard_chnkd_gen[ii]:\n", + " whard_chnkd_gen[ii] = 0\n", + " else:\n", + " weasy_chnkd_gen[ii] = 0\n", + " weasy_chnkd_gen_cumsum = weasy_chnkd_gen.cumsum()\n", + " whard_chnkd_gen_cumsum = whard_chnkd_gen.cumsum()\n", + " w_all_chnkd_gen_cumsum = weasy_chnkd_gen_cumsum + whard_chnkd_gen_cumsum\n", + " # Get synthetic patch pref\n", + " end_idxs = np.arange(pref_first_idx, n_samples, 1).astype(int)\n", + " start_idxs = np.zeros((len(end_idxs),)).astype(int)\n", + " for i, idx in enumerate(end_idxs):\n", + " start_idxs[i] = np.where(\n", + " (w_all_chnkd_gen_cumsum[0:idx] + w_chunk_dist) \n", + " > w_all_chnkd_gen_cumsum[idx]\n", + " )[0][0]\n", + " weasy_diff_gen = weasy_chnkd_gen_cumsum[end_idxs] - weasy_chnkd_gen_cumsum[start_idxs]\n", + " whard_diff_gen = whard_chnkd_gen_cumsum[end_idxs] - whard_chnkd_gen_cumsum[start_idxs]\n", + " weasy_pref_gen = weasy_diff_gen / (weasy_diff_gen + whard_diff_gen)\n", + " syn_chunk_pref_dists[distri_n, :] = weasy_pref_gen\n", + "# /sss>\n", + "# \n", + "# high_bound)[0]\n", + "# For each pref_idx, find the first earlier idx with `pref_window` less\n", + "# cum distance, then see if pref over this window is > `pref_thresh`\n", + "for pref_start_idx in pref_idxs:\n", + " pref_end_idx = np.where(\n", + " w_all_chnkd_cumsum[pref_start_idx:] \n", + " > (w_all_chnkd_cumsum[pref_start_idx] + pref_window)\n", + " )[0]\n", + " if pref_end_idx.size > 0:\n", + " pref_end_idx = pref_end_idx[0] + pref_start_idx\n", + " pref_p = np.sum(\n", + " weasy_pref[pref_start_idx : pref_end_idx] \n", + " > high_bound[pref_start_idx : pref_end_idx]\n", + " ) / (pref_end_idx - pref_start_idx)\n", + " if pref_p > pref_thresh:\n", + " learned_start_idx = pref_start_idx\n", + " learned_end_idx = pref_end_idx\n", + " break\n", + "# /sss>\n", + "cont_patch_pref = DotMap(\n", + " w_all_chnkd_cumsum=w_all_chnkd_cumsum.astype('float32'),\n", + " weasy_pref=weasy_pref.astype('float32'),\n", + " low_bound=low_bound.astype('float32'),\n", + " high_bound=high_bound.astype('float32'),\n", + " learned_start_idx=learned_start_idx,\n", + " learned_end_idx=learned_end_idx,\n", + " thresh_change_idx=(safe_change_ts - s.enter).seconds\n", + ")\n", + "sessions.at[s.Index, \"cont_patch_pref\"] = cont_patch_pref\n", + "if learned_start_idx:\n", + " print(f\"Learned: {s.id} {s.enter} ... {post_easy_rate} {post_hard_rate}\")\n", + "# /ss> /s>" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Questions" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "- In a block, what percentage of time do they end on easy block?" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.11.5" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} From addd63c74fbbcf3e13f6ba58e33fd67ee25edc4e Mon Sep 17 00:00:00 2001 From: Jai Date: Wed, 14 Feb 2024 16:20:17 +0000 Subject: [PATCH 09/14] fixed broken var names --- social01_block_analysis.ipynb | 5271 +++------------------------------ 1 file changed, 392 insertions(+), 4879 deletions(-) diff --git a/social01_block_analysis.ipynb b/social01_block_analysis.ipynb index 0e56d515..f0e381e2 100644 --- a/social01_block_analysis.ipynb +++ b/social01_block_analysis.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -201,257 +201,9 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\732382373.py:39: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", - " if block_info.pellet_ct[i - 1] > 0:\n", - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\732382373.py:41: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", - " elif block_info.pellet_ct[i - 1] == 0 and block_info.index[i] - block_info.index[i - 1] > pd.Timedelta(\"1s\"):\n", - "c:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:139: FutureWarning: The behavior of array concatenation with empty entries is deprecated. In a future version, this will no longer exclude empty items when determining the result dtype. To retain the old behavior, exclude the empty entries before the concat operation.\n", - " data = pd.concat([reader.read(file) for _, file in files])\n", - "c:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:139: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", - " data = pd.concat([reader.read(file) for _, file in files])\n", - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\732382373.py:39: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", - " if block_info.pellet_ct[i - 1] > 0:\n", - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\732382373.py:41: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", - " elif block_info.pellet_ct[i - 1] == 0 and block_info.index[i] - block_info.index[i - 1] > pd.Timedelta(\"1s\"):\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
rootsleap_model_dirstartendblock_durationsubjectspatch_infopellet_infocum_wheel_dist
0Z:\\aeon\\data\\raw\\AEON4\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...2024-01-31 12:59:06.0059838292024-01-31 14:58:11.045983791NoneNoneNoneNoneNone
1Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-01-31 12:59:14.0019841192024-01-31 14:45:59.000000000NoneNoneNoneNoneNone
2Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-01-31 14:45:55.0000000002024-01-31 16:18:11.001984119NoneNoneNoneNoneNone
3Z:\\aeon\\data\\raw\\AEON4\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...2024-01-31 14:58:07.0459837912024-01-31 17:49:26.000000000NoneNoneNoneNoneNone
4Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-01-31 16:18:07.0019841192024-01-31 17:56:23.000000000NoneNoneNoneNoneNone
..............................
269Z:\\aeon\\data\\raw\\AEON4\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...2024-02-13 11:46:05.0000000002024-02-13 13:02:51.049983978NoneNoneNoneNoneNone
270Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-02-13 12:40:27.0000000002024-02-13 15:17:20.001984119NoneNoneNoneNoneNone
271Z:\\aeon\\data\\raw\\AEON4\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...2024-02-13 13:02:47.0499839782024-02-13 15:32:22.001984119NoneNoneNoneNoneNone
272Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-02-13 15:17:16.0019841192024-02-13 18:03:15.001984119NoneNoneNoneNoneNone
273Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-02-13 18:03:11.0019841192024-02-13 20:29:47.021984100NoneNoneNoneNoneNone
\n", - "

274 rows × 9 columns

\n", - "
" - ], - "text/plain": [ - " root \\\n", - "0 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", - "1 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", - "2 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", - "3 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", - "4 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", - ".. ... \n", - "269 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", - "270 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", - "271 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", - "272 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", - "273 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", - "\n", - " sleap_model_dir \\\n", - "0 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", - "1 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", - "2 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", - "3 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", - "4 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", - ".. ... \n", - "269 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", - "270 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", - "271 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", - "272 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", - "273 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", - "\n", - " start end \\\n", - "0 2024-01-31 12:59:06.005983829 2024-01-31 14:58:11.045983791 \n", - "1 2024-01-31 12:59:14.001984119 2024-01-31 14:45:59.000000000 \n", - "2 2024-01-31 14:45:55.000000000 2024-01-31 16:18:11.001984119 \n", - "3 2024-01-31 14:58:07.045983791 2024-01-31 17:49:26.000000000 \n", - "4 2024-01-31 16:18:07.001984119 2024-01-31 17:56:23.000000000 \n", - ".. ... ... \n", - "269 2024-02-13 11:46:05.000000000 2024-02-13 13:02:51.049983978 \n", - "270 2024-02-13 12:40:27.000000000 2024-02-13 15:17:20.001984119 \n", - "271 2024-02-13 13:02:47.049983978 2024-02-13 15:32:22.001984119 \n", - "272 2024-02-13 15:17:16.001984119 2024-02-13 18:03:15.001984119 \n", - "273 2024-02-13 18:03:11.001984119 2024-02-13 20:29:47.021984100 \n", - "\n", - " block_duration subjects patch_info pellet_info cum_wheel_dist \n", - "0 None None None None None \n", - "1 None None None None None \n", - "2 None None None None None \n", - "3 None None None None None \n", - "4 None None None None None \n", - ".. ... ... ... ... ... \n", - "269 None None None None None \n", - "270 None None None None None \n", - "271 None None None None None \n", - "272 None None None None None \n", - "273 None None None None None \n", - "\n", - "[274 rows x 9 columns]" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "\"\"\"Create a blocks df.\"\"\"\n", "\n", @@ -544,18 +296,9 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "c:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:139: FutureWarning: The behavior of array concatenation with empty entries is deprecated. In a future version, this will no longer exclude empty items when determining the result dtype. To retain the old behavior, exclude the empty entries before the concat operation.\n", - " data = pd.concat([reader.read(file) for _, file in files])\n" - ] - } - ], + "outputs": [], "source": [ "\"\"\"Get subject env visits.\"\"\"\n", "\n", @@ -577,53 +320,9 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'AEON3': id type region\n", - " time \n", - " 2024-01-31 11:28:45.543519974 BAA-1104045 Remain Environment\n", - " 2024-02-01 22:36:53.196512222 BAA-1104045 Remain Environment\n", - " 2024-02-02 00:15:06.000000000 BAA-1104045 Remain Environment\n", - " 2024-02-03 16:28:29.139999866 BAA-1104045 Exit Environment\n", - " 2024-02-05 15:43:11.581535816 BAA-1104047 Remain Environment\n", - " 2024-02-08 14:49:41.552000046 BAA-1104047 Exit Environment\n", - " 2024-02-09 16:25:49.935999870 BAA-1104045 Enter Environment\n", - " 2024-02-09 16:26:07.579999924 BAA-1104047 Enter Environment,\n", - " 'AEON4': id type region\n", - " time \n", - " 2024-01-31 10:22:40.191999912 BAA-1104048 Enter Environment\n", - " 2024-02-01 20:46:53.905536175 BAA-1104048 Remain Environment\n", - " 2024-02-01 23:34:58.098527908 BAA-1104048 Remain Environment\n", - " 2024-02-01 23:40:29.825535774 BAA-1104048 Remain Environment\n", - " 2024-02-03 16:34:00.159999847 BAA-1104048 Exit Environment\n", - " 2024-02-05 14:59:57.992000103 BAA-1104049 Enter Environment\n", - " 2024-02-08 14:54:20.616000175 BAA-1104049 Exit Environment\n", - " 2024-02-09 16:48:31.208000183 BAA-1104048 Enter Environment\n", - " 2024-02-09 16:48:44.848000050 BAA-1104049 Enter Environment\n", - " 2024-02-13 15:06:53.121535778 BAA-1104048 Remain Environment\n", - " 2024-02-13 15:06:53.121535778 BAA-1104049 Remain Environment\n", - " 2024-02-13 15:09:16.763519764 BAA-1104048 Remain Environment\n", - " 2024-02-13 15:09:16.763519764 BAA-1104049 Remain Environment\n", - " 2024-02-13 15:20:19.109536171 BAA-1104048 Remain Environment\n", - " 2024-02-13 15:20:19.109536171 BAA-1104049 Remain Environment\n", - " 2024-02-13 15:23:22.901535988 BAA-1104048 Remain Environment\n", - " 2024-02-13 15:23:22.901535988 BAA-1104049 Remain Environment\n", - " 2024-02-13 15:26:20.574528217 BAA-1104048 Remain Environment\n", - " 2024-02-13 15:26:20.574528217 BAA-1104049 Remain Environment\n", - " 2024-02-13 15:31:09.248511791 BAA-1104048 Remain Environment\n", - " 2024-02-13 15:31:09.248511791 BAA-1104049 Remain Environment\n", - " 2024-02-13 15:32:04.505536079 BAA-1104048 Remain Environment}" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "subject_env_visits" ] @@ -636,6 +335,8 @@ "source": [ "\"\"\"Fill out blocks df.\"\"\"\n", "\n", + "skipped_blocks = np.full(len(blocks_df), False)\n", + "\n", "for i, block in enumerate(blocks_df.itertuples()):\n", " # Compute block duration\n", " blocks_df.at[block.Index, \"block_duration\"] = block.end - block.start\n", @@ -668,8 +369,8 @@ " r = eval(f\"social02.{patch}.DepletionState\")\n", " patch_df = aeon.load(block.root, r, block.start, block.end)\n", " cum_pel_ct += sum(np.diff(patch_df.index) > pd.Timedelta(\"1s\"))\n", - " if cum_pel_ct < good_block_pel_ct:\n", - " continue\n", + " # if cum_pel_ct < good_block_pel_ct:\n", + " # continue\n", " # /s>\n", " # \n", " # #/sss> #/ss>\n", " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", " # /s>\n", " blocks_df.at[block.Index, \"patch_info\"] = patch_stats_df\n", " blocks_df.at[block.Index, \"pellet_info\"] = pellets_stats_df\n", - " blocks_df.at[block.Index, \"cum_wheel_dist\"] = cum_wheel_dist_dm\n", - "\n", - "display(blocks_df)" + " blocks_df.at[block.Index, \"cum_wheel_dist\"] = cum_wheel_dist_dm" ] }, { "cell_type": "code", - "execution_count": 63, + "execution_count": null, "metadata": {}, "outputs": [], - "source": [ - "block = list(blocks_df.itertuples())[4]" - ] + "source": [] }, { "cell_type": "code", - "execution_count": 82, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "c:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", - " data.loc[data[\"class\"] == i, \"class\"] = subj\n", - "c:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", - " distance = distance - distance[0]\n", - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\1365078609.py:86: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", - " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n" - ] - }, - { - "ename": "KeyboardInterrupt", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", - "Cell \u001b[1;32mIn[82], line 41\u001b[0m\n\u001b[0;32m 38\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, patch \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(patches):\n\u001b[0;32m 39\u001b[0m \u001b[38;5;66;03m# 41\u001b[0m wheel_df \u001b[38;5;241m=\u001b[39m \u001b[43maeon\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload\u001b[49m\u001b[43m(\u001b[49m\u001b[43mblock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mroot\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mr\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mblock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstart\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mblock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mend\u001b[49m\u001b[43m)\u001b[49m[::\u001b[38;5;241m50\u001b[39m]\n\u001b[0;32m 42\u001b[0m cum_wheel_dist \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m-\u001b[39mdistancetravelled(wheel_df\u001b[38;5;241m.\u001b[39mangle)\n\u001b[0;32m 43\u001b[0m \u001b[38;5;66;03m# /ss>\u001b[39;00m\n\u001b[0;32m 44\u001b[0m \u001b[38;5;66;03m# 86\u001b[0m fileset \u001b[38;5;241m=\u001b[39m \u001b[43m{\u001b[49m\n\u001b[0;32m 87\u001b[0m \u001b[43m \u001b[49m\u001b[43mchunk_key\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfname\u001b[49m\u001b[43m)\u001b[49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mfname\u001b[49m\n\u001b[0;32m 88\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mroot\u001b[49m\n\u001b[0;32m 89\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mfname\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mglob\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43mf\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mepoch_pattern\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[38;5;124;43m/**/\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mreader\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpattern\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[38;5;124;43m.\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mreader\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mextension\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[0;32m 90\u001b[0m \u001b[43m\u001b[49m\u001b[43m}\u001b[49m\n\u001b[0;32m 91\u001b[0m files \u001b[38;5;241m=\u001b[39m \u001b[38;5;28msorted\u001b[39m(fileset\u001b[38;5;241m.\u001b[39mitems())\n\u001b[0;32m 93\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m time \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m 94\u001b[0m \u001b[38;5;66;03m# ensure input is converted to timestamp series\u001b[39;00m\n", - "File \u001b[1;32mc:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:86\u001b[0m, in \u001b[0;36m\u001b[1;34m(.0)\u001b[0m\n\u001b[0;32m 83\u001b[0m root \u001b[38;5;241m=\u001b[39m [root]\n\u001b[0;32m 85\u001b[0m epoch_pattern \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m**\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m epoch \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;28;01melse\u001b[39;00m epoch\n\u001b[1;32m---> 86\u001b[0m fileset \u001b[38;5;241m=\u001b[39m {\n\u001b[0;32m 87\u001b[0m chunk_key(fname): fname\n\u001b[0;32m 88\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m path \u001b[38;5;129;01min\u001b[39;00m root\n\u001b[0;32m 89\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m fname \u001b[38;5;129;01min\u001b[39;00m path\u001b[38;5;241m.\u001b[39mglob(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mepoch_pattern\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m/**/\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mreader\u001b[38;5;241m.\u001b[39mpattern\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m.\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mreader\u001b[38;5;241m.\u001b[39mextension\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 90\u001b[0m }\n\u001b[0;32m 91\u001b[0m files \u001b[38;5;241m=\u001b[39m \u001b[38;5;28msorted\u001b[39m(fileset\u001b[38;5;241m.\u001b[39mitems())\n\u001b[0;32m 93\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m time \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m 94\u001b[0m \u001b[38;5;66;03m# ensure input is converted to timestamp series\u001b[39;00m\n", - "File \u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\pathlib.py:953\u001b[0m, in \u001b[0;36mPath.glob\u001b[1;34m(self, pattern)\u001b[0m\n\u001b[0;32m 951\u001b[0m pattern_parts\u001b[38;5;241m.\u001b[39mappend(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m 952\u001b[0m selector \u001b[38;5;241m=\u001b[39m _make_selector(\u001b[38;5;28mtuple\u001b[39m(pattern_parts), \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_flavour)\n\u001b[1;32m--> 953\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m p \u001b[38;5;129;01min\u001b[39;00m selector\u001b[38;5;241m.\u001b[39mselect_from(\u001b[38;5;28mself\u001b[39m):\n\u001b[0;32m 954\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m p\n", - "File \u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\pathlib.py:408\u001b[0m, in \u001b[0;36m_RecursiveWildcardSelector._select_from\u001b[1;34m(self, parent_path, is_dir, exists, scandir)\u001b[0m\n\u001b[0;32m 406\u001b[0m successor_select \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msuccessor\u001b[38;5;241m.\u001b[39m_select_from\n\u001b[0;32m 407\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m starting_point \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_iterate_directories(parent_path, is_dir, scandir):\n\u001b[1;32m--> 408\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m p \u001b[38;5;129;01min\u001b[39;00m successor_select(starting_point, is_dir, exists, scandir):\n\u001b[0;32m 409\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m p \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m yielded:\n\u001b[0;32m 410\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m p\n", - "File \u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\pathlib.py:408\u001b[0m, in \u001b[0;36m_RecursiveWildcardSelector._select_from\u001b[1;34m(self, parent_path, is_dir, exists, scandir)\u001b[0m\n\u001b[0;32m 406\u001b[0m successor_select \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msuccessor\u001b[38;5;241m.\u001b[39m_select_from\n\u001b[0;32m 407\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m starting_point \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_iterate_directories(parent_path, is_dir, scandir):\n\u001b[1;32m--> 408\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m p \u001b[38;5;129;01min\u001b[39;00m successor_select(starting_point, is_dir, exists, scandir):\n\u001b[0;32m 409\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m p \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m yielded:\n\u001b[0;32m 410\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m p\n", - "File \u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\pathlib.py:356\u001b[0m, in \u001b[0;36m_WildcardSelector._select_from\u001b[1;34m(self, parent_path, is_dir, exists, scandir)\u001b[0m\n\u001b[0;32m 354\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 355\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m scandir(parent_path) \u001b[38;5;28;01mas\u001b[39;00m scandir_it:\n\u001b[1;32m--> 356\u001b[0m entries \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlist\u001b[39m(scandir_it)\n\u001b[0;32m 357\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m entry \u001b[38;5;129;01min\u001b[39;00m entries:\n\u001b[0;32m 358\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdironly:\n", - "\u001b[1;31mKeyboardInterrupt\u001b[0m: " - ] - } - ], + "outputs": [], "source": [ - " blocks_df.at[block.Index, \"block_duration\"] = block.end - block.start\n", - " # /s>\n", - " # \n", - " # \n", + "# pd.Timedelta(\"1s\"))\n", + "# if cum_pel_ct < good_block_pel_ct:\n", + "# continue\n", + "# /s>\n", + "# \n", + "# patch_info\n", + "cum_wheel_dist_dm = DotMap() # -> cum_wheel_dist\n", + "pellets_stats_df = pd.DataFrame(columns=[\"time\", \"patch\", \"threshold\", \"id\"]) # -> pellet_info\n", + "for i, patch in enumerate(patches):\n", + " # \n", + " # pd.Timedelta(\"1s\"), (True,)))\n", + " patch_df_for_pellets_df = patch_df[patch_df_good_indxs].reset_index()[[\"time\", \"threshold\"]]\n", + " patch_df_for_pellets_df[\"patch\"] = patch\n", + " patch_df_for_pellets_df[\"id\"] = None\n", + " patch_df_for_pellets_df.dropna(subset=[\"threshold\"], inplace=True)\n", + " # drop 1st val as is from block start\n", + " patch_df_for_pellets_df = patch_df_for_pellets_df.iloc[1:].reset_index(drop=True)\n", + " # /ss>\n", + " # \n", + " # \n", + " # \n", + " # #/sss> #/ss>\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", " # /s>\n", - " # \n", - " # pd.Timedelta(\"1s\"), (True,)))\n", - " patch_df_for_pellets_df = patch_df[patch_df_good_indxs].reset_index()[[\"time\", \"threshold\"]]\n", - " patch_df_for_pellets_df[\"patch\"] = patch\n", - " patch_df_for_pellets_df[\"id\"] = None\n", - " patch_df_for_pellets_df.dropna(subset=[\"threshold\"], inplace=True)\n", - " # drop 1st val as is from block start\n", - " patch_df_for_pellets_df = patch_df_for_pellets_df.iloc[1:].reset_index(drop=True)\n", - " # /ss>\n", - " # \n", - " # \n", - " # Get closest subject to patch at each pel del timestep\n", - " patch_df_for_pellets_df[\"id\"] = dist_to_patch_pel_ts_id_df.idxmin(axis=1).values\n", - " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", - " # /ss> /s>\n", - " blocks_df.at[block.Index, \"patch_info\"] = patch_stats_df\n", - " blocks_df.at[block.Index, \"pellet_info\"] = pellets_stats_df\n", - " blocks_df.at[block.Index, \"cum_wheel_dist\"] = cum_wheel_dist_dm\n" + "blocks_df.at[block.Index, \"patch_info\"] = patch_stats_df\n", + "blocks_df.at[block.Index, \"pellet_info\"] = pellets_stats_df\n", + "blocks_df.at[block.Index, \"cum_wheel_dist\"] = cum_wheel_dist_dm" ] }, { "cell_type": "code", - "execution_count": 93, + "execution_count": 14, "metadata": {}, "outputs": [ { - "name": "stderr", + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
meanoffset
Patch1303.03030375.0
Patch2100.075.0
Patch3500.075.0
\n", + "
" + ], + "text/plain": [ + " mean offset\n", + "Patch1 303.030303 75.0\n", + "Patch2 100.0 75.0\n", + "Patch3 500.0 75.0" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", "output_type": "stream", "text": [ - "c:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", - " data.loc[data[\"class\"] == i, \"class\"] = subj\n" + "Subject cum wheel dist for patch='Patch1'\n" ] }, { @@ -943,4066 +689,104 @@ " \n", " \n", " \n", - " class\n", - " class_likelihood\n", - " part\n", - " x\n", - " y\n", - " part_likelihood\n", + " BAA-1104045\n", + " BAA-1104047\n", " \n", " \n", " time\n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", " \n", - " 2024-02-14 08:00:00.019999981\n", - " BAA-1104045\n", - " 0.987112\n", - " centroid\n", - " 1259.260010\n", - " 536.543274\n", - " 0.538822\n", + " 2024-02-13 15:17:16.001984119\n", + " -0.000000\n", + " 0.000000\n", " \n", " \n", - " 2024-02-14 08:00:00.019999981\n", - " BAA-1104047\n", - " 0.587085\n", - " centroid\n", - " 1269.920776\n", - " 555.007690\n", - " 0.538822\n", + " 2024-02-13 15:17:16.101984024\n", + " -0.006136\n", + " 0.000000\n", " \n", " \n", - " 2024-02-14 08:00:00.079999924\n", - " BAA-1104045\n", - " 0.997696\n", - " centroid\n", - " 1256.660889\n", - " 536.355957\n", - " 0.524928\n", + " 2024-02-13 15:17:16.201983929\n", + " 0.001534\n", + " 0.000000\n", " \n", " \n", - " 2024-02-14 08:00:00.079999924\n", - " BAA-1104045\n", - " 0.525753\n", - " centroid\n", - " 1272.174805\n", - " 555.194458\n", - " 0.524928\n", + " 2024-02-13 15:17:16.301983833\n", + " 0.000000\n", + " 0.000000\n", " \n", " \n", - " 2024-02-14 08:00:00.139999866\n", - " BAA-1104045\n", - " 0.993752\n", - " centroid\n", - " 1256.811279\n", - " 539.052246\n", - " 0.495777\n", - " \n", - " \n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " \n", - " \n", - " 2024-02-14 08:59:59.840000153\n", - " BAA-1104045\n", - " 0.764098\n", - " centroid\n", - " 595.052551\n", - " 368.538788\n", - " 0.951113\n", - " \n", - " \n", - " 2024-02-14 08:59:59.840000153\n", - " BAA-1104045\n", - " 0.847785\n", - " centroid\n", - " 1299.120605\n", - " 498.892639\n", - " 0.951113\n", - " \n", - " \n", - " 2024-02-14 08:59:59.900000095\n", - " BAA-1104045\n", - " 0.668274\n", - " centroid\n", - " 595.155579\n", - " 368.437073\n", - " 0.983769\n", - " \n", - " \n", - " 2024-02-14 08:59:59.900000095\n", - " BAA-1104047\n", - " 0.853135\n", - " centroid\n", - " 1299.102173\n", - " 496.867737\n", - " 0.983769\n", - " \n", - " \n", - " 2024-02-14 08:59:59.960000038\n", - " BAA-1104047\n", - " 0.596216\n", - " centroid\n", - " 595.175049\n", - " 368.380341\n", - " 0.979406\n", - " \n", - " \n", - "\n", - "

110635 rows × 6 columns

\n", - "" - ], - "text/plain": [ - " class class_likelihood part \\\n", - "time \n", - "2024-02-14 08:00:00.019999981 BAA-1104045 0.987112 centroid \n", - "2024-02-14 08:00:00.019999981 BAA-1104047 0.587085 centroid \n", - "2024-02-14 08:00:00.079999924 BAA-1104045 0.997696 centroid \n", - "2024-02-14 08:00:00.079999924 BAA-1104045 0.525753 centroid \n", - "2024-02-14 08:00:00.139999866 BAA-1104045 0.993752 centroid \n", - "... ... ... ... \n", - "2024-02-14 08:59:59.840000153 BAA-1104045 0.764098 centroid \n", - "2024-02-14 08:59:59.840000153 BAA-1104045 0.847785 centroid \n", - "2024-02-14 08:59:59.900000095 BAA-1104045 0.668274 centroid \n", - "2024-02-14 08:59:59.900000095 BAA-1104047 0.853135 centroid \n", - "2024-02-14 08:59:59.960000038 BAA-1104047 0.596216 centroid \n", - "\n", - " x y part_likelihood \n", - "time \n", - "2024-02-14 08:00:00.019999981 1259.260010 536.543274 0.538822 \n", - "2024-02-14 08:00:00.019999981 1269.920776 555.007690 0.538822 \n", - "2024-02-14 08:00:00.079999924 1256.660889 536.355957 0.524928 \n", - "2024-02-14 08:00:00.079999924 1272.174805 555.194458 0.524928 \n", - "2024-02-14 08:00:00.139999866 1256.811279 539.052246 0.495777 \n", - "... ... ... ... \n", - "2024-02-14 08:59:59.840000153 595.052551 368.538788 0.951113 \n", - "2024-02-14 08:59:59.840000153 1299.120605 498.892639 0.951113 \n", - "2024-02-14 08:59:59.900000095 595.155579 368.437073 0.983769 \n", - "2024-02-14 08:59:59.900000095 1299.102173 496.867737 0.983769 \n", - "2024-02-14 08:59:59.960000038 595.175049 368.380341 0.979406 \n", - "\n", - "[110635 rows x 6 columns]" - ] - }, - "execution_count": 93, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "start, end = pd.Timestamp(\"2024-02-14 08:00:00\"), pd.Timestamp(\"2024-02-14 09:00:00\")\n", - "pose_df = aeon.load(block.root, social02.CameraTop.Pose, start, end)\n", - "pose_df = reader.Pose.class_int2str(pose_df, block.sleap_model_dir)\n", - "pose_df" - ] - }, - { - "cell_type": "code", - "execution_count": 105, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "c:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", - " distance = distance - distance[0]\n" - ] - } - ], - "source": [ - "cum_wheel_dist_dm = DotMap()\n", - "patch_stats_df = pd.DataFrame(index=patches, columns=[\"mean\", \"offset\"])\n", - "pellets_stats_df = pd.DataFrame(columns=[\"time\", \"patch\", \"threshold\", \"id\"])\n", - "\n", - "r = eval(f\"social02.{patch}.Encoder\")\n", - "wheel_df = aeon.load(block.root, r, start, end)[::50].round(1).astype(np.float32)\n", - "cum_wheel_dist = -distancetravelled(wheel_df.angle)\n", - "# /ss>\n", - "# pd.Timedelta(\"1s\"), (True,)))\n", - "patch_df_for_pellets_df = patch_df[patch_df_good_indxs].reset_index()[[\"time\", \"threshold\"]]\n", - "patch_df_for_pellets_df[\"patch\"] = patch\n", - "patch_df_for_pellets_df[\"id\"] = None\n", - "patch_df_for_pellets_df.dropna(subset=[\"threshold\"], inplace=True)\n", - "# drop 1st val as is from block start\n", - "patch_df_for_pellets_df = patch_df_for_pellets_df.iloc[1:].reset_index(drop=True)\n", - "# /ss>\n", - "# \n", - " # \n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
BAA-1104045
time
2024-02-14 08:00:00.000000000-0.000000
2024-02-14 08:00:00.0999999050.001534
2024-02-14 08:00:00.199999809-0.006136
2024-02-14 08:00:00.300000191-0.001534
2024-02-14 08:00:00.400000095-0.003068
......
2024-02-14 08:59:59.5000000004394.620038
2024-02-14 08:59:59.5999999054394.618504
2024-02-14 08:59:59.6999998094394.615436
2024-02-14 08:59:59.8000001914394.615436
2024-02-14 08:59:59.9000000954394.618504
\n", - "

36000 rows × 1 columns

\n", - "" - ], - "text/plain": [ - " BAA-1104045\n", - "time \n", - "2024-02-14 08:00:00.000000000 -0.000000\n", - "2024-02-14 08:00:00.099999905 0.001534\n", - "2024-02-14 08:00:00.199999809 -0.006136\n", - "2024-02-14 08:00:00.300000191 -0.001534\n", - "2024-02-14 08:00:00.400000095 -0.003068\n", - "... ...\n", - "2024-02-14 08:59:59.500000000 4394.620038\n", - "2024-02-14 08:59:59.599999905 4394.618504\n", - "2024-02-14 08:59:59.699999809 4394.615436\n", - "2024-02-14 08:59:59.800000191 4394.615436\n", - "2024-02-14 08:59:59.900000095 4394.618504\n", - "\n", - "[36000 rows x 1 columns]" - ] - }, - "execution_count": 163, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Convert series to df with column name \"subject\"\n", - "cum_wheel_dist.to_frame(name=subjects[0])" - ] - }, - { - "cell_type": "code", - "execution_count": 155, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
BAA-1104045BAA-1104047
time
2024-02-14 08:00:00.000000000-0.0000000.000000
2024-02-14 08:00:00.0999999050.0015340.000000
2024-02-14 08:00:00.199999809-0.0061360.000000
2024-02-14 08:00:00.300000191-0.0015340.000000
2024-02-14 08:00:00.400000095-0.0030680.000000
.........
2024-02-14 08:59:59.5000000001247.8268723146.785496
2024-02-14 08:59:59.5999999051247.8253383146.785496
2024-02-14 08:59:59.6999998091247.8253383146.782427
2024-02-14 08:59:59.8000001911247.8253383146.782427
2024-02-14 08:59:59.9000000951247.8284063146.782427
\n", - "

36000 rows × 2 columns

\n", - "
" - ], - "text/plain": [ - " BAA-1104045 BAA-1104047\n", - "time \n", - "2024-02-14 08:00:00.000000000 -0.000000 0.000000\n", - "2024-02-14 08:00:00.099999905 0.001534 0.000000\n", - "2024-02-14 08:00:00.199999809 -0.006136 0.000000\n", - "2024-02-14 08:00:00.300000191 -0.001534 0.000000\n", - "2024-02-14 08:00:00.400000095 -0.003068 0.000000\n", - "... ... ...\n", - "2024-02-14 08:59:59.500000000 1247.826872 3146.785496\n", - "2024-02-14 08:59:59.599999905 1247.825338 3146.785496\n", - "2024-02-14 08:59:59.699999809 1247.825338 3146.782427\n", - "2024-02-14 08:59:59.800000191 1247.825338 3146.782427\n", - "2024-02-14 08:59:59.900000095 1247.828406 3146.782427\n", - "\n", - "[36000 rows x 2 columns]" - ] - }, - "execution_count": 155, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cum_wheel_dist_dm[subjects[0]][patch]" - ] - }, - { - "cell_type": "code", - "execution_count": 150, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\3670313934.py:2: FutureWarning: The behavior of DataFrame.idxmin with all-NA values, or any-NA and skipna=False, is deprecated. In a future version this will raise ValueError\n", - " closest_subjects = dist_to_patch_wheel_ts_id_df.idxmin(axis=1)\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
BAA-1104045BAA-1104047
time
2024-02-14 08:00:00.000000000-0.0000000.000000
2024-02-14 08:00:00.0999999050.0015340.001534
2024-02-14 08:00:00.199999809-0.007670-0.007670
2024-02-14 08:00:00.3000001910.0046020.004602
2024-02-14 08:00:00.400000095-0.001534-0.001534
.........
2024-02-14 08:59:59.500000000-0.001534-0.001534
2024-02-14 08:59:59.599999905-0.001534-0.001534
2024-02-14 08:59:59.6999998090.000000-0.003068
2024-02-14 08:59:59.8000001910.0000000.000000
2024-02-14 08:59:59.9000000950.0030680.003068
\n", - "

36000 rows × 2 columns

\n", - "
" - ], - "text/plain": [ - " BAA-1104045 BAA-1104047\n", - "time \n", - "2024-02-14 08:00:00.000000000 -0.000000 0.000000\n", - "2024-02-14 08:00:00.099999905 0.001534 0.001534\n", - "2024-02-14 08:00:00.199999809 -0.007670 -0.007670\n", - "2024-02-14 08:00:00.300000191 0.004602 0.004602\n", - "2024-02-14 08:00:00.400000095 -0.001534 -0.001534\n", - "... ... ...\n", - "2024-02-14 08:59:59.500000000 -0.001534 -0.001534\n", - "2024-02-14 08:59:59.599999905 -0.001534 -0.001534\n", - "2024-02-14 08:59:59.699999809 0.000000 -0.003068\n", - "2024-02-14 08:59:59.800000191 0.000000 0.000000\n", - "2024-02-14 08:59:59.900000095 0.003068 0.003068\n", - "\n", - "[36000 rows x 2 columns]" - ] - }, - "execution_count": 150, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cum_wheel_dist_subj_df = pd.DataFrame(index=cum_wheel_dist.index, columns=subjects, data=0.0)\n", - "closest_subjects = dist_to_patch_wheel_ts_id_df.idxmin(axis=1)\n", - "wheel_dist = cum_wheel_dist.diff().fillna(cum_wheel_dist.iloc[0])\n", - "for subject in subjects:\n", - " subj_idxs = cum_wheel_dist_subj_df[closest_subjects == subject].index\n", - " cum_wheel_dist_subj_df.loc[subj_idxs, subject] = wheel_dist[closest_subjects == subject]\n", - "cum_wheel_dist_subj_df.cumsum(axis=1)" - ] - }, - { - "cell_type": "code", - "execution_count": 136, - "metadata": {}, - "outputs": [ - { - "ename": "AttributeError", - "evalue": "'DataFrame' object has no attribute 'subject'", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m~\\AppData\\Local\\Temp\\ipykernel_63676\\475597327.py\u001b[0m in \u001b[0;36m?\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mcum_wheel_dist_subj_df\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msubject\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mclosest_subjects\u001b[0m \u001b[1;33m==\u001b[0m \u001b[0msubject\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\site-packages\\pandas\\core\\generic.py\u001b[0m in \u001b[0;36m?\u001b[1;34m(self, name)\u001b[0m\n\u001b[0;32m 6198\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mname\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_accessors\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6199\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_info_axis\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_can_hold_identifiers_and_holds_name\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6200\u001b[0m ):\n\u001b[0;32m 6201\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 6202\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mobject\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__getattribute__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mAttributeError\u001b[0m: 'DataFrame' object has no attribute 'subject'" - ] - } - ], - "source": [ - "cum_wheel_dist_subj_df[subject][closest_subjects == subject]" - ] - }, - { - "cell_type": "code", - "execution_count": 144, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\434192056.py:2: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[ 0.00153407 0. -0.00460222 ... -0.00153407 0.\n", - " -0.00306815]' has dtype incompatible with int64, please explicitly cast to a compatible dtype first.\n", - " cum_wheel_dist_subj_df.loc[subj_idxs, subject] = wheel_dist[closest_subjects == subject]\n" - ] - } - ], - "source": [ - "subj_idxs = cum_wheel_dist_subj_df[closest_subjects == subject].index\n", - "cum_wheel_dist_subj_df.loc[subj_idxs, subject] = wheel_dist[closest_subjects == subject]" - ] - }, - { - "cell_type": "code", - "execution_count": 148, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "time\n", - "2024-02-14 08:00:00.000000000 -0.000000\n", - "2024-02-14 08:00:00.099999905 0.001534\n", - "2024-02-14 08:00:00.199999809 -0.006136\n", - "2024-02-14 08:00:00.300000191 -0.001534\n", - "2024-02-14 08:00:00.400000095 -0.003068\n", - " ... \n", - "2024-02-14 08:59:59.500000000 4394.620038\n", - "2024-02-14 08:59:59.599999905 4394.618504\n", - "2024-02-14 08:59:59.699999809 4394.615436\n", - "2024-02-14 08:59:59.800000191 4394.615436\n", - "2024-02-14 08:59:59.900000095 4394.618504\n", - "Name: angle, Length: 36000, dtype: float64" - ] - }, - "execution_count": 148, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cum_wheel_dist" - ] - }, - { - "cell_type": "code", - "execution_count": 146, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "time\n", - "2024-02-14 08:00:03.699999809 0.001534\n", - "2024-02-14 08:00:03.800000191 0.001534\n", - "2024-02-14 08:00:03.900000095 -0.003068\n", - "2024-02-14 08:00:04.000000000 0.001534\n", - "2024-02-14 08:00:04.099999905 0.000000\n", - " ... \n", - "2024-02-14 08:59:58.699999809 3146.783961\n", - "2024-02-14 08:59:58.900000095 3146.787030\n", - "2024-02-14 08:59:59.000000000 3146.785496\n", - "2024-02-14 08:59:59.300000191 3146.785496\n", - "2024-02-14 08:59:59.699999809 3146.782427\n", - "Name: angle, Length: 21992, dtype: float64" - ] - }, - "execution_count": 146, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "wheel_dist[closest_subjects == subject].cumsum()" - ] - }, - { - "cell_type": "code", - "execution_count": 145, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
BAA-1104045BAA-1104047
time
2024-02-14 08:00:00.00000000000.000000
2024-02-14 08:00:00.09999990500.000000
2024-02-14 08:00:00.19999980900.000000
2024-02-14 08:00:00.30000019100.000000
2024-02-14 08:00:00.40000009500.000000
.........
2024-02-14 08:59:59.50000000000.000000
2024-02-14 08:59:59.59999990500.000000
2024-02-14 08:59:59.6999998090-0.003068
2024-02-14 08:59:59.80000019100.000000
2024-02-14 08:59:59.90000009500.000000
\n", - "

36000 rows × 2 columns

\n", - "
" - ], - "text/plain": [ - " BAA-1104045 BAA-1104047\n", - "time \n", - "2024-02-14 08:00:00.000000000 0 0.000000\n", - "2024-02-14 08:00:00.099999905 0 0.000000\n", - "2024-02-14 08:00:00.199999809 0 0.000000\n", - "2024-02-14 08:00:00.300000191 0 0.000000\n", - "2024-02-14 08:00:00.400000095 0 0.000000\n", - "... ... ...\n", - "2024-02-14 08:59:59.500000000 0 0.000000\n", - "2024-02-14 08:59:59.599999905 0 0.000000\n", - "2024-02-14 08:59:59.699999809 0 -0.003068\n", - "2024-02-14 08:59:59.800000191 0 0.000000\n", - "2024-02-14 08:59:59.900000095 0 0.000000\n", - "\n", - "[36000 rows x 2 columns]" - ] - }, - "execution_count": 145, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cum_wheel_dist_subj_df" - ] - }, - { - "cell_type": "code", - "execution_count": 138, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'BAA-1104047'" - ] - }, - "execution_count": 138, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "subject" - ] - }, - { - "cell_type": "code", - "execution_count": 139, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "time\n", - "2024-02-14 08:00:00.000000000 0\n", - "2024-02-14 08:00:00.099999905 0\n", - "2024-02-14 08:00:00.199999809 0\n", - "2024-02-14 08:00:00.300000191 0\n", - "2024-02-14 08:00:00.400000095 0\n", - " ..\n", - "2024-02-14 08:59:59.500000000 0\n", - "2024-02-14 08:59:59.599999905 0\n", - "2024-02-14 08:59:59.699999809 0\n", - "2024-02-14 08:59:59.800000191 0\n", - "2024-02-14 08:59:59.900000095 0\n", - "Name: BAA-1104047, Length: 36000, dtype: int64" - ] - }, - "execution_count": 139, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cum_wheel_dist_subj_df[subject]" - ] - }, - { - "cell_type": "code", - "execution_count": 133, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'BAA-1104047'" - ] - }, - "execution_count": 133, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "subject" - ] - }, - { - "cell_type": "code", - "execution_count": 131, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "time\n", - "2024-02-14 08:00:03.699999809 0.001534\n", - "2024-02-14 08:00:03.800000191 0.000000\n", - "2024-02-14 08:00:03.900000095 -0.004602\n", - "2024-02-14 08:00:04.000000000 0.004602\n", - "2024-02-14 08:00:04.099999905 -0.001534\n", - " ... \n", - "2024-02-14 08:59:58.699999809 0.003068\n", - "2024-02-14 08:59:58.900000095 0.003068\n", - "2024-02-14 08:59:59.000000000 -0.001534\n", - "2024-02-14 08:59:59.300000191 0.000000\n", - "2024-02-14 08:59:59.699999809 -0.003068\n", - "Name: angle, Length: 21992, dtype: float64" - ] - }, - "execution_count": 131, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "wheel_dist[closest_subjects == subject]" - ] - }, - { - "cell_type": "code", - "execution_count": 127, - "metadata": {}, - "outputs": [ - { - "ename": "AttributeError", - "evalue": "'DataFrame' object has no attribute 'subject'", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m~\\AppData\\Local\\Temp\\ipykernel_63676\\475597327.py\u001b[0m in \u001b[0;36m?\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mcum_wheel_dist_subj_df\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msubject\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mclosest_subjects\u001b[0m \u001b[1;33m==\u001b[0m \u001b[0msubject\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\site-packages\\pandas\\core\\generic.py\u001b[0m in \u001b[0;36m?\u001b[1;34m(self, name)\u001b[0m\n\u001b[0;32m 6198\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mname\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_accessors\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6199\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_info_axis\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_can_hold_identifiers_and_holds_name\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6200\u001b[0m ):\n\u001b[0;32m 6201\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 6202\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mobject\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__getattribute__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mAttributeError\u001b[0m: 'DataFrame' object has no attribute 'subject'" - ] - } - ], - "source": [ - "cum_wheel_dist_subj_df.subject[closest_subjects == subject]" - ] - }, - { - "cell_type": "code", - "execution_count": 125, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_63676\\332053637.py:2: FutureWarning: The behavior of DataFrame.idxmin with all-NA values, or any-NA and skipna=False, is deprecated. In a future version this will raise ValueError\n", - " closest_subjects = dist_to_patch_wheel_ts_id_df.idxmin(axis=1)\n" - ] - } - ], - "source": [ - "cum_wheel_dist_subj_df = pd.DataFrame(index=cum_wheel_dist.index, columns=subjects, data=0)\n", - "closest_subjects = dist_to_patch_wheel_ts_id_df.idxmin(axis=1)\n", - "wheel_dist = cum_wheel_dist.diff().fillna(cum_wheel_dist.iloc[0])" - ] - }, - { - "cell_type": "code", - "execution_count": 126, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "time\n", - "2024-02-14 08:00:03.699999809 0.001534\n", - "2024-02-14 08:00:03.800000191 0.000000\n", - "2024-02-14 08:00:03.900000095 -0.004602\n", - "2024-02-14 08:00:04.000000000 0.004602\n", - "2024-02-14 08:00:04.099999905 -0.001534\n", - " ... \n", - "2024-02-14 08:59:58.699999809 0.003068\n", - "2024-02-14 08:59:58.900000095 0.003068\n", - "2024-02-14 08:59:59.000000000 -0.001534\n", - "2024-02-14 08:59:59.300000191 0.000000\n", - "2024-02-14 08:59:59.699999809 -0.003068\n", - "Name: angle, Length: 21992, dtype: float64" - ] - }, - "execution_count": 126, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "wheel_dist[closest_subjects == subject]" - ] - }, - { - "cell_type": "code", - "execution_count": 122, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "time\n", - "2024-02-14 08:00:00.000000000 -0.000000\n", - "2024-02-14 08:00:00.099999905 0.001534\n", - "2024-02-14 08:00:00.199999809 -0.006136\n", - "2024-02-14 08:00:00.300000191 -0.001534\n", - "2024-02-14 08:00:00.400000095 -0.003068\n", - " ... \n", - "2024-02-14 08:59:59.500000000 4394.620038\n", - "2024-02-14 08:59:59.599999905 4394.618504\n", - "2024-02-14 08:59:59.699999809 4394.615436\n", - "2024-02-14 08:59:59.800000191 4394.615436\n", - "2024-02-14 08:59:59.900000095 4394.618504\n", - "Name: angle, Length: 36000, dtype: float64" - ] - }, - "execution_count": 122, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cum_wheel_dist" - ] - }, - { - "cell_type": "code", - "execution_count": 124, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "time\n", - "2024-02-14 08:00:00.000000000 NaN\n", - "2024-02-14 08:00:00.099999905 0.001534\n", - "2024-02-14 08:00:00.199999809 -0.007670\n", - "2024-02-14 08:00:00.300000191 0.004602\n", - "2024-02-14 08:00:00.400000095 -0.001534\n", - " ... \n", - "2024-02-14 08:59:59.500000000 -0.001534\n", - "2024-02-14 08:59:59.599999905 -0.001534\n", - "2024-02-14 08:59:59.699999809 -0.003068\n", - "2024-02-14 08:59:59.800000191 0.000000\n", - "2024-02-14 08:59:59.900000095 0.003068\n", - "Name: angle, Length: 36000, dtype: float64" - ] - }, - "execution_count": 124, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [] - }, - { - "cell_type": "code", - "execution_count": 118, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
BAA-1104045BAA-1104047
time
2024-02-14 08:00:00.000000000693.885635698.566247
2024-02-14 08:00:00.099999905690.778328698.661071
2024-02-14 08:00:00.199999809690.418638698.643935
2024-02-14 08:00:00.300000191687.212969700.757699
2024-02-14 08:00:00.400000095683.109510700.926455
.........
2024-02-14 08:59:59.500000000384.701512741.401770
2024-02-14 08:59:59.599999905386.913748743.527414
2024-02-14 08:59:59.699999809743.851848384.906781
2024-02-14 08:59:59.800000191384.493044744.545220
2024-02-14 08:59:59.900000095384.593439744.545220
\n", - "

36000 rows × 2 columns

\n", - "
" - ], - "text/plain": [ - " BAA-1104045 BAA-1104047\n", - "time \n", - "2024-02-14 08:00:00.000000000 693.885635 698.566247\n", - "2024-02-14 08:00:00.099999905 690.778328 698.661071\n", - "2024-02-14 08:00:00.199999809 690.418638 698.643935\n", - "2024-02-14 08:00:00.300000191 687.212969 700.757699\n", - "2024-02-14 08:00:00.400000095 683.109510 700.926455\n", - "... ... ...\n", - "2024-02-14 08:59:59.500000000 384.701512 741.401770\n", - "2024-02-14 08:59:59.599999905 386.913748 743.527414\n", - "2024-02-14 08:59:59.699999809 743.851848 384.906781\n", - "2024-02-14 08:59:59.800000191 384.493044 744.545220\n", - "2024-02-14 08:59:59.900000095 384.593439 744.545220\n", - "\n", - "[36000 rows x 2 columns]" - ] - }, - "execution_count": 118, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dist_to_patch_wheel_ts_id_df" - ] - }, - { - "cell_type": "code", - "execution_count": 117, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
BAA-1104045BAA-1104047
time
2024-02-14 08:02:19.219999790746.210657NaN
2024-02-14 08:02:43.84198379521.425895749.594314
2024-02-14 08:05:23.16998386421.432737380.245593
2024-02-14 08:11:36.375999928633.40308023.403707
2024-02-14 08:13:55.437983990567.54796723.516178
2024-02-14 08:14:07.480000019342.01459123.583132
2024-02-14 08:16:26.765984058276.62725523.568197
2024-02-14 08:19:22.361983776562.15601523.203993
2024-02-14 08:19:33.853983879539.38256524.981456
2024-02-14 08:22:26.412000179302.21972123.412274
2024-02-14 08:23:13.721983910NaN23.219379
2024-02-14 08:23:57.76800012613.15708725.565686
2024-02-14 08:24:20.10198402421.508134320.565067
2024-02-14 08:24:40.70598411621.739176684.281538
2024-02-14 08:26:23.029983997691.44632223.530254
2024-02-14 08:29:16.335999966248.76299723.449587
2024-02-14 08:34:36.980000019392.47572819.970090
2024-02-14 08:35:02.955999851680.25630823.376212
2024-02-14 08:42:52.768000126468.48743723.423807
2024-02-14 08:43:12.713984013384.99788823.517266
2024-02-14 08:45:27.19600009921.502719751.062865
2024-02-14 08:45:37.736000061450.582448NaN
2024-02-14 08:46:39.004000186555.656947387.174379
\n", - "
" - ], - "text/plain": [ - " BAA-1104045 BAA-1104047\n", - "time \n", - "2024-02-14 08:02:19.219999790 746.210657 NaN\n", - "2024-02-14 08:02:43.841983795 21.425895 749.594314\n", - "2024-02-14 08:05:23.169983864 21.432737 380.245593\n", - "2024-02-14 08:11:36.375999928 633.403080 23.403707\n", - "2024-02-14 08:13:55.437983990 567.547967 23.516178\n", - "2024-02-14 08:14:07.480000019 342.014591 23.583132\n", - "2024-02-14 08:16:26.765984058 276.627255 23.568197\n", - "2024-02-14 08:19:22.361983776 562.156015 23.203993\n", - "2024-02-14 08:19:33.853983879 539.382565 24.981456\n", - "2024-02-14 08:22:26.412000179 302.219721 23.412274\n", - "2024-02-14 08:23:13.721983910 NaN 23.219379\n", - "2024-02-14 08:23:57.768000126 13.157087 25.565686\n", - "2024-02-14 08:24:20.101984024 21.508134 320.565067\n", - "2024-02-14 08:24:40.705984116 21.739176 684.281538\n", - "2024-02-14 08:26:23.029983997 691.446322 23.530254\n", - "2024-02-14 08:29:16.335999966 248.762997 23.449587\n", - "2024-02-14 08:34:36.980000019 392.475728 19.970090\n", - "2024-02-14 08:35:02.955999851 680.256308 23.376212\n", - "2024-02-14 08:42:52.768000126 468.487437 23.423807\n", - "2024-02-14 08:43:12.713984013 384.997888 23.517266\n", - "2024-02-14 08:45:27.196000099 21.502719 751.062865\n", - "2024-02-14 08:45:37.736000061 450.582448 NaN\n", - "2024-02-14 08:46:39.004000186 555.656947 387.174379" - ] - }, - "execution_count": 117, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dist_to_patch_pel_ts_id_df" - ] - }, - { - "cell_type": "code", - "execution_count": 116, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
timethresholdpatchid
02024-02-14 08:02:19.219999790361.785049Patch2BAA-1104045
12024-02-14 08:02:43.841983795194.950509Patch2BAA-1104045
22024-02-14 08:05:23.16998386488.046672Patch2BAA-1104045
32024-02-14 08:11:36.37599992885.945754Patch2BAA-1104047
42024-02-14 08:13:55.43798399076.270649Patch2BAA-1104047
52024-02-14 08:14:07.480000019205.543520Patch2BAA-1104047
62024-02-14 08:16:26.76598405888.423802Patch2BAA-1104047
72024-02-14 08:19:22.36198377696.462577Patch2BAA-1104047
82024-02-14 08:19:33.853983879132.625352Patch2BAA-1104047
92024-02-14 08:22:26.412000179372.380471Patch2BAA-1104047
102024-02-14 08:23:13.72198391088.550613Patch2BAA-1104047
112024-02-14 08:23:57.768000126158.293375Patch2BAA-1104045
122024-02-14 08:24:20.10198402494.946606Patch2BAA-1104045
132024-02-14 08:24:40.705984116128.350386Patch2BAA-1104045
142024-02-14 08:26:23.029983997103.003226Patch2BAA-1104047
152024-02-14 08:29:16.335999966439.736339Patch2BAA-1104047
162024-02-14 08:34:36.980000019241.119074Patch2BAA-1104047
172024-02-14 08:35:02.955999851209.483334Patch2BAA-1104047
182024-02-14 08:42:52.768000126169.083744Patch2BAA-1104047
192024-02-14 08:43:12.713984013146.062839Patch2BAA-1104047
202024-02-14 08:45:27.19600009988.638738Patch2BAA-1104045
212024-02-14 08:45:37.73600006180.205599Patch2BAA-1104045
222024-02-14 08:46:39.004000186205.907633Patch2BAA-1104047
\n", - "
" - ], - "text/plain": [ - " time threshold patch id\n", - "0 2024-02-14 08:02:19.219999790 361.785049 Patch2 BAA-1104045\n", - "1 2024-02-14 08:02:43.841983795 194.950509 Patch2 BAA-1104045\n", - "2 2024-02-14 08:05:23.169983864 88.046672 Patch2 BAA-1104045\n", - "3 2024-02-14 08:11:36.375999928 85.945754 Patch2 BAA-1104047\n", - "4 2024-02-14 08:13:55.437983990 76.270649 Patch2 BAA-1104047\n", - "5 2024-02-14 08:14:07.480000019 205.543520 Patch2 BAA-1104047\n", - "6 2024-02-14 08:16:26.765984058 88.423802 Patch2 BAA-1104047\n", - "7 2024-02-14 08:19:22.361983776 96.462577 Patch2 BAA-1104047\n", - "8 2024-02-14 08:19:33.853983879 132.625352 Patch2 BAA-1104047\n", - "9 2024-02-14 08:22:26.412000179 372.380471 Patch2 BAA-1104047\n", - "10 2024-02-14 08:23:13.721983910 88.550613 Patch2 BAA-1104047\n", - "11 2024-02-14 08:23:57.768000126 158.293375 Patch2 BAA-1104045\n", - "12 2024-02-14 08:24:20.101984024 94.946606 Patch2 BAA-1104045\n", - "13 2024-02-14 08:24:40.705984116 128.350386 Patch2 BAA-1104045\n", - "14 2024-02-14 08:26:23.029983997 103.003226 Patch2 BAA-1104047\n", - "15 2024-02-14 08:29:16.335999966 439.736339 Patch2 BAA-1104047\n", - "16 2024-02-14 08:34:36.980000019 241.119074 Patch2 BAA-1104047\n", - "17 2024-02-14 08:35:02.955999851 209.483334 Patch2 BAA-1104047\n", - "18 2024-02-14 08:42:52.768000126 169.083744 Patch2 BAA-1104047\n", - "19 2024-02-14 08:43:12.713984013 146.062839 Patch2 BAA-1104047\n", - "20 2024-02-14 08:45:27.196000099 88.638738 Patch2 BAA-1104045\n", - "21 2024-02-14 08:45:37.736000061 80.205599 Patch2 BAA-1104045\n", - "22 2024-02-14 08:46:39.004000186 205.907633 Patch2 BAA-1104047" - ] - }, - "execution_count": 116, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "patch_df_for_pellets_df" - ] - }, - { - "cell_type": "code", - "execution_count": 107, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
classdist_to_patch
time
2024-02-14 08:00:00.019999981BAA-1104045693.885635
2024-02-14 08:00:00.019999981BAA-1104047698.566247
2024-02-14 08:00:00.079999924BAA-1104045691.475353
2024-02-14 08:00:00.079999924BAA-1104045700.675389
2024-02-14 08:00:00.139999866BAA-1104045690.778328
.........
2024-02-14 08:59:59.840000153BAA-1104045384.493044
2024-02-14 08:59:59.840000153BAA-1104045743.868383
2024-02-14 08:59:59.900000095BAA-1104045384.593439
2024-02-14 08:59:59.900000095BAA-1104047744.545220
2024-02-14 08:59:59.960000038BAA-1104047384.649922
\n", - "

110635 rows × 2 columns

\n", - "
" - ], - "text/plain": [ - " class dist_to_patch\n", - "time \n", - "2024-02-14 08:00:00.019999981 BAA-1104045 693.885635\n", - "2024-02-14 08:00:00.019999981 BAA-1104047 698.566247\n", - "2024-02-14 08:00:00.079999924 BAA-1104045 691.475353\n", - "2024-02-14 08:00:00.079999924 BAA-1104045 700.675389\n", - "2024-02-14 08:00:00.139999866 BAA-1104045 690.778328\n", - "... ... ...\n", - "2024-02-14 08:59:59.840000153 BAA-1104045 384.493044\n", - "2024-02-14 08:59:59.840000153 BAA-1104045 743.868383\n", - "2024-02-14 08:59:59.900000095 BAA-1104045 384.593439\n", - "2024-02-14 08:59:59.900000095 BAA-1104047 744.545220\n", - "2024-02-14 08:59:59.960000038 BAA-1104047 384.649922\n", - "\n", - "[110635 rows x 2 columns]" - ] - }, - "execution_count": 107, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dist_to_patch_df" - ] - }, - { - "cell_type": "code", - "execution_count": 103, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
BAA-1104045BAA-1104047
time
2024-02-14 08:00:00.000000000693.885635693.885635
2024-02-14 08:00:00.099999905690.778328690.778328
2024-02-14 08:00:00.199999809690.418638690.418638
2024-02-14 08:00:00.300000191687.212969687.212969
2024-02-14 08:00:00.400000095683.109510683.109510
.........
2024-02-14 08:59:59.500000000384.701512384.701512
2024-02-14 08:59:59.599999905386.913748386.913748
2024-02-14 08:59:59.699999809384.906781384.906781
2024-02-14 08:59:59.800000191384.493044384.493044
2024-02-14 08:59:59.900000095384.593439384.593439
\n", - "

36000 rows × 2 columns

\n", - "
" - ], - "text/plain": [ - " BAA-1104045 BAA-1104047\n", - "time \n", - "2024-02-14 08:00:00.000000000 693.885635 693.885635\n", - "2024-02-14 08:00:00.099999905 690.778328 690.778328\n", - "2024-02-14 08:00:00.199999809 690.418638 690.418638\n", - "2024-02-14 08:00:00.300000191 687.212969 687.212969\n", - "2024-02-14 08:00:00.400000095 683.109510 683.109510\n", - "... ... ...\n", - "2024-02-14 08:59:59.500000000 384.701512 384.701512\n", - "2024-02-14 08:59:59.599999905 386.913748 386.913748\n", - "2024-02-14 08:59:59.699999809 384.906781 384.906781\n", - "2024-02-14 08:59:59.800000191 384.493044 384.493044\n", - "2024-02-14 08:59:59.900000095 384.593439 384.593439\n", - "\n", - "[36000 rows x 2 columns]" - ] - }, - "execution_count": 103, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dist_to_patch_wheel_ts_id_df" - ] - }, - { - "cell_type": "code", - "execution_count": 102, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
BAA-1104045BAA-1104047classdist_to_patch
time
2024-02-14 08:00:00.000000000693.885635NaNBAA-1104045693.885635
2024-02-14 08:00:00.099999905690.778328NaNBAA-1104045690.778328
2024-02-14 08:00:00.199999809690.418638NaNBAA-1104045690.418638
2024-02-14 08:00:00.300000191687.212969NaNBAA-1104045687.212969
2024-02-14 08:00:00.400000095683.109510NaNBAA-1104045683.109510
...............
2024-02-14 08:59:59.500000000384.701512NaNBAA-1104045384.701512
2024-02-14 08:59:59.599999905386.913748NaNBAA-1104045386.913748
2024-02-14 08:59:59.699999809384.906781NaNBAA-1104047384.906781
2024-02-14 08:59:59.800000191384.493044NaNBAA-1104045384.493044
2024-02-14 08:59:59.900000095384.593439NaNBAA-1104045384.593439
\n", - "

36000 rows × 4 columns

\n", - "
" - ], - "text/plain": [ - " BAA-1104045 BAA-1104047 class \\\n", - "time \n", - "2024-02-14 08:00:00.000000000 693.885635 NaN BAA-1104045 \n", - "2024-02-14 08:00:00.099999905 690.778328 NaN BAA-1104045 \n", - "2024-02-14 08:00:00.199999809 690.418638 NaN BAA-1104045 \n", - "2024-02-14 08:00:00.300000191 687.212969 NaN BAA-1104045 \n", - "2024-02-14 08:00:00.400000095 683.109510 NaN BAA-1104045 \n", - "... ... ... ... \n", - "2024-02-14 08:59:59.500000000 384.701512 NaN BAA-1104045 \n", - "2024-02-14 08:59:59.599999905 386.913748 NaN BAA-1104045 \n", - "2024-02-14 08:59:59.699999809 384.906781 NaN BAA-1104047 \n", - "2024-02-14 08:59:59.800000191 384.493044 NaN BAA-1104045 \n", - "2024-02-14 08:59:59.900000095 384.593439 NaN BAA-1104045 \n", - "\n", - " dist_to_patch \n", - "time \n", - "2024-02-14 08:00:00.000000000 693.885635 \n", - "2024-02-14 08:00:00.099999905 690.778328 \n", - "2024-02-14 08:00:00.199999809 690.418638 \n", - "2024-02-14 08:00:00.300000191 687.212969 \n", - "2024-02-14 08:00:00.400000095 683.109510 \n", - "... ... \n", - "2024-02-14 08:59:59.500000000 384.701512 \n", - "2024-02-14 08:59:59.599999905 386.913748 \n", - "2024-02-14 08:59:59.699999809 384.906781 \n", - "2024-02-14 08:59:59.800000191 384.493044 \n", - "2024-02-14 08:59:59.900000095 384.593439 \n", - "\n", - "[36000 rows x 4 columns]" - ] - }, - "execution_count": 102, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dist_to_patch_wheel_ts_subj" - ] - }, - { - "cell_type": "code", - "execution_count": 100, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
BAA-1104045BAA-1104047classdist_to_patch
time
2024-02-14 08:02:19.219999790746.210657NaNBAA-1104045746.210657
2024-02-14 08:02:43.841983795749.594314NaNBAA-1104047749.594314
2024-02-14 08:05:23.169983864380.245593NaNBAA-1104047380.245593
2024-02-14 08:11:36.375999928633.403080NaNBAA-1104045633.403080
2024-02-14 08:13:55.43798399023.516178NaNBAA-110404723.516178
2024-02-14 08:14:07.48000001923.583132NaNBAA-110404723.583132
2024-02-14 08:16:26.76598405823.568197NaNBAA-110404723.568197
2024-02-14 08:19:22.361983776562.156015NaNBAA-1104045562.156015
2024-02-14 08:19:33.853983879539.382565NaNBAA-1104045539.382565
2024-02-14 08:22:26.41200017923.412274NaNBAA-110404723.412274
2024-02-14 08:23:13.72198391023.219379NaNBAA-110404723.219379
2024-02-14 08:23:57.76800012625.565686NaNBAA-110404725.565686
2024-02-14 08:24:20.10198402421.508134NaNBAA-110404521.508134
2024-02-14 08:24:40.705984116684.281538NaNBAA-1104047684.281538
2024-02-14 08:26:23.029983997691.446322NaNBAA-1104045691.446322
2024-02-14 08:29:16.33599996623.449587NaNBAA-110404723.449587
2024-02-14 08:34:36.980000019392.475728NaNBAA-1104045392.475728
2024-02-14 08:35:02.955999851680.256308NaNBAA-1104045680.256308
2024-02-14 08:42:52.76800012623.423807NaNBAA-110404723.423807
2024-02-14 08:43:12.713984013384.997888NaNBAA-1104045384.997888
2024-02-14 08:45:27.196000099751.062865NaNBAA-1104047751.062865
2024-02-14 08:45:37.736000061450.582448NaNBAA-1104045450.582448
2024-02-14 08:46:39.004000186555.656947NaNBAA-1104045555.656947
\n", - "
" - ], - "text/plain": [ - " BAA-1104045 BAA-1104047 class \\\n", - "time \n", - "2024-02-14 08:02:19.219999790 746.210657 NaN BAA-1104045 \n", - "2024-02-14 08:02:43.841983795 749.594314 NaN BAA-1104047 \n", - "2024-02-14 08:05:23.169983864 380.245593 NaN BAA-1104047 \n", - "2024-02-14 08:11:36.375999928 633.403080 NaN BAA-1104045 \n", - "2024-02-14 08:13:55.437983990 23.516178 NaN BAA-1104047 \n", - "2024-02-14 08:14:07.480000019 23.583132 NaN BAA-1104047 \n", - "2024-02-14 08:16:26.765984058 23.568197 NaN BAA-1104047 \n", - "2024-02-14 08:19:22.361983776 562.156015 NaN BAA-1104045 \n", - "2024-02-14 08:19:33.853983879 539.382565 NaN BAA-1104045 \n", - "2024-02-14 08:22:26.412000179 23.412274 NaN BAA-1104047 \n", - "2024-02-14 08:23:13.721983910 23.219379 NaN BAA-1104047 \n", - "2024-02-14 08:23:57.768000126 25.565686 NaN BAA-1104047 \n", - "2024-02-14 08:24:20.101984024 21.508134 NaN BAA-1104045 \n", - "2024-02-14 08:24:40.705984116 684.281538 NaN BAA-1104047 \n", - "2024-02-14 08:26:23.029983997 691.446322 NaN BAA-1104045 \n", - "2024-02-14 08:29:16.335999966 23.449587 NaN BAA-1104047 \n", - "2024-02-14 08:34:36.980000019 392.475728 NaN BAA-1104045 \n", - "2024-02-14 08:35:02.955999851 680.256308 NaN BAA-1104045 \n", - "2024-02-14 08:42:52.768000126 23.423807 NaN BAA-1104047 \n", - "2024-02-14 08:43:12.713984013 384.997888 NaN BAA-1104045 \n", - "2024-02-14 08:45:27.196000099 751.062865 NaN BAA-1104047 \n", - "2024-02-14 08:45:37.736000061 450.582448 NaN BAA-1104045 \n", - "2024-02-14 08:46:39.004000186 555.656947 NaN BAA-1104045 \n", - "\n", - " dist_to_patch \n", - "time \n", - "2024-02-14 08:02:19.219999790 746.210657 \n", - "2024-02-14 08:02:43.841983795 749.594314 \n", - "2024-02-14 08:05:23.169983864 380.245593 \n", - "2024-02-14 08:11:36.375999928 633.403080 \n", - "2024-02-14 08:13:55.437983990 23.516178 \n", - "2024-02-14 08:14:07.480000019 23.583132 \n", - "2024-02-14 08:16:26.765984058 23.568197 \n", - "2024-02-14 08:19:22.361983776 562.156015 \n", - "2024-02-14 08:19:33.853983879 539.382565 \n", - "2024-02-14 08:22:26.412000179 23.412274 \n", - "2024-02-14 08:23:13.721983910 23.219379 \n", - "2024-02-14 08:23:57.768000126 25.565686 \n", - "2024-02-14 08:24:20.101984024 21.508134 \n", - "2024-02-14 08:24:40.705984116 684.281538 \n", - "2024-02-14 08:26:23.029983997 691.446322 \n", - "2024-02-14 08:29:16.335999966 23.449587 \n", - "2024-02-14 08:34:36.980000019 392.475728 \n", - "2024-02-14 08:35:02.955999851 680.256308 \n", - "2024-02-14 08:42:52.768000126 23.423807 \n", - "2024-02-14 08:43:12.713984013 384.997888 \n", - "2024-02-14 08:45:27.196000099 751.062865 \n", - "2024-02-14 08:45:37.736000061 450.582448 \n", - "2024-02-14 08:46:39.004000186 555.656947 " - ] - }, - "execution_count": 100, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dist_to_patch_pel_ts_subj" - ] - }, - { - "cell_type": "code", - "execution_count": 78, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[1259.26 , 536.5433 ],\n", - " [1269.9208 , 555.0077 ],\n", - " [1256.6609 , 536.35596],\n", - " ...,\n", - " [ 595.1556 , 368.43707],\n", - " [1299.1022 , 496.86774],\n", - " [ 595.17505, 368.38034]], dtype=float32)" - ] - }, - "execution_count": 78, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "subjects_xy = pose_df[pose_df[\"part\"] == \"centroid\"][[\"x\", \"y\"]].values\n", - "subjects_xy" - ] - }, - { - "cell_type": "code", - "execution_count": 79, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "(110635, 2)" - ] - }, - "execution_count": 79, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "subjects_xy.shape" - ] - }, - { - "cell_type": "code", - "execution_count": 80, - "metadata": {}, - "outputs": [], - "source": [ - "dist_to_patch = np.sqrt(np.sum((subjects_xy - patch_xy) ** 2, axis=1))\n", - "dist_to_patch_df = pose_df[[\"class\"]].copy()\n", - "dist_to_patch_df[\"dist_to_patch\"] = dist_to_patch" - ] - }, - { - "cell_type": "code", - "execution_count": 81, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
classdist_to_patch
time
2024-02-14 08:00:00.019999981BAA-1104045696.273687
2024-02-14 08:00:00.019999981BAA-1104047711.691849
2024-02-14 08:00:00.079999924BAA-1104045693.721146
2024-02-14 08:00:00.079999924BAA-1104045713.902905
2024-02-14 08:00:00.139999866BAA-1104045694.602667
.........
2024-02-14 08:59:59.840000153BAA-110404521.412034
2024-02-14 08:59:59.840000153BAA-1104045725.975112
2024-02-14 08:59:59.900000095BAA-110404521.343971
2024-02-14 08:59:59.900000095BAA-1104047725.538902
2024-02-14 08:59:59.960000038BAA-110404721.295293
\n", - "

110635 rows × 2 columns

\n", - "
" - ], - "text/plain": [ - " class dist_to_patch\n", - "time \n", - "2024-02-14 08:00:00.019999981 BAA-1104045 696.273687\n", - "2024-02-14 08:00:00.019999981 BAA-1104047 711.691849\n", - "2024-02-14 08:00:00.079999924 BAA-1104045 693.721146\n", - "2024-02-14 08:00:00.079999924 BAA-1104045 713.902905\n", - "2024-02-14 08:00:00.139999866 BAA-1104045 694.602667\n", - "... ... ...\n", - "2024-02-14 08:59:59.840000153 BAA-1104045 21.412034\n", - "2024-02-14 08:59:59.840000153 BAA-1104045 725.975112\n", - "2024-02-14 08:59:59.900000095 BAA-1104045 21.343971\n", - "2024-02-14 08:59:59.900000095 BAA-1104047 725.538902\n", - "2024-02-14 08:59:59.960000038 BAA-1104047 21.295293\n", - "\n", - "[110635 rows x 2 columns]" - ] - }, - "execution_count": 81, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dist_to_patch_df" - ] - }, - { - "cell_type": "code", - "execution_count": 83, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
BAA-1104045
time
2024-01-31 17:46:01.92998409319.174071
2024-01-31 17:46:18.98799991615.551528
2024-01-31 17:46:37.32399988219.905172
2024-01-31 17:46:52.65798378019.984235
2024-01-31 17:47:07.56198406221.056611
2024-01-31 17:47:18.12799978317.622595
2024-01-31 17:47:29.80800008819.765585
2024-01-31 17:47:44.27398395517.342467
2024-01-31 17:47:58.58198404321.922041
2024-01-31 17:48:20.59999990518.808438
2024-01-31 17:48:34.61398410820.958044
2024-01-31 17:49:30.23600006121.401976
2024-01-31 17:53:13.27199983619.659521
2024-01-31 17:53:39.99398422221.454221
2024-01-31 17:53:55.45200014122.236733
\n", - "
" - ], - "text/plain": [ - " BAA-1104045\n", - "time \n", - "2024-01-31 17:46:01.929984093 19.174071\n", - "2024-01-31 17:46:18.987999916 15.551528\n", - "2024-01-31 17:46:37.323999882 19.905172\n", - "2024-01-31 17:46:52.657983780 19.984235\n", - "2024-01-31 17:47:07.561984062 21.056611\n", - "2024-01-31 17:47:18.127999783 17.622595\n", - "2024-01-31 17:47:29.808000088 19.765585\n", - "2024-01-31 17:47:44.273983955 17.342467\n", - "2024-01-31 17:47:58.581984043 21.922041\n", - "2024-01-31 17:48:20.599999905 18.808438\n", - "2024-01-31 17:48:34.613984108 20.958044\n", - "2024-01-31 17:49:30.236000061 21.401976\n", - "2024-01-31 17:53:13.271999836 19.659521\n", - "2024-01-31 17:53:39.993984222 21.454221\n", - "2024-01-31 17:53:55.452000141 22.236733" - ] - }, - "execution_count": 83, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dist_to_patch_id_df" - ] - }, - { - "cell_type": "code", - "execution_count": 69, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
timethresholdpatchid
02024-01-31 17:46:01.929984093166.161345Patch3BAA-1104045
12024-01-31 17:46:18.987999916201.563446Patch3BAA-1104045
22024-01-31 17:46:37.323999882148.860696Patch3BAA-1104045
32024-01-31 17:46:52.657983780155.151245Patch3BAA-1104045
42024-01-31 17:47:07.56198406285.592153Patch3BAA-1104045
52024-01-31 17:47:18.127999783132.567869Patch3BAA-1104045
62024-01-31 17:47:29.808000088148.151722Patch3BAA-1104045
72024-01-31 17:47:44.273983955118.466936Patch3BAA-1104045
82024-01-31 17:47:58.581984043104.584493Patch3BAA-1104045
92024-01-31 17:48:20.59999990588.933069Patch3BAA-1104045
102024-01-31 17:48:34.613984108405.436991Patch3BAA-1104045
112024-01-31 17:49:30.236000061194.962748Patch3BAA-1104045
122024-01-31 17:53:13.271999836156.343961Patch3BAA-1104045
132024-01-31 17:53:39.99398422290.257312Patch3BAA-1104045
142024-01-31 17:53:55.45200014182.164552Patch3BAA-1104045
\n", - "
" - ], - "text/plain": [ - " time threshold patch id\n", - "0 2024-01-31 17:46:01.929984093 166.161345 Patch3 BAA-1104045\n", - "1 2024-01-31 17:46:18.987999916 201.563446 Patch3 BAA-1104045\n", - "2 2024-01-31 17:46:37.323999882 148.860696 Patch3 BAA-1104045\n", - "3 2024-01-31 17:46:52.657983780 155.151245 Patch3 BAA-1104045\n", - "4 2024-01-31 17:47:07.561984062 85.592153 Patch3 BAA-1104045\n", - "5 2024-01-31 17:47:18.127999783 132.567869 Patch3 BAA-1104045\n", - "6 2024-01-31 17:47:29.808000088 148.151722 Patch3 BAA-1104045\n", - "7 2024-01-31 17:47:44.273983955 118.466936 Patch3 BAA-1104045\n", - "8 2024-01-31 17:47:58.581984043 104.584493 Patch3 BAA-1104045\n", - "9 2024-01-31 17:48:20.599999905 88.933069 Patch3 BAA-1104045\n", - "10 2024-01-31 17:48:34.613984108 405.436991 Patch3 BAA-1104045\n", - "11 2024-01-31 17:49:30.236000061 194.962748 Patch3 BAA-1104045\n", - "12 2024-01-31 17:53:13.271999836 156.343961 Patch3 BAA-1104045\n", - "13 2024-01-31 17:53:39.993984222 90.257312 Patch3 BAA-1104045\n", - "14 2024-01-31 17:53:55.452000141 82.164552 Patch3 BAA-1104045" - ] - }, - "execution_count": 69, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "patch_df_for_pellets_df" - ] - }, - { - "cell_type": "code", - "execution_count": 68, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
BAA-1104045
time
2024-01-31 17:46:01.92998409319.174071
2024-01-31 17:46:18.98799991615.551528
2024-01-31 17:46:37.32399988219.905172
2024-01-31 17:46:52.65798378019.984235
2024-01-31 17:47:07.56198406221.056611
2024-01-31 17:47:18.12799978317.622595
2024-01-31 17:47:29.80800008819.765585
2024-01-31 17:47:44.27398395517.342467
2024-01-31 17:47:58.58198404321.922041
2024-01-31 17:48:20.59999990518.808438
2024-01-31 17:48:34.61398410820.958044
2024-01-31 17:49:30.23600006121.401976
2024-01-31 17:53:13.27199983619.659521
2024-01-31 17:53:39.99398422221.454221
2024-01-31 17:53:55.45200014122.236733
\n", - "
" - ], - "text/plain": [ - " BAA-1104045\n", - "time \n", - "2024-01-31 17:46:01.929984093 19.174071\n", - "2024-01-31 17:46:18.987999916 15.551528\n", - "2024-01-31 17:46:37.323999882 19.905172\n", - "2024-01-31 17:46:52.657983780 19.984235\n", - "2024-01-31 17:47:07.561984062 21.056611\n", - "2024-01-31 17:47:18.127999783 17.622595\n", - "2024-01-31 17:47:29.808000088 19.765585\n", - "2024-01-31 17:47:44.273983955 17.342467\n", - "2024-01-31 17:47:58.581984043 21.922041\n", - "2024-01-31 17:48:20.599999905 18.808438\n", - "2024-01-31 17:48:34.613984108 20.958044\n", - "2024-01-31 17:49:30.236000061 21.401976\n", - "2024-01-31 17:53:13.271999836 19.659521\n", - "2024-01-31 17:53:39.993984222 21.454221\n", - "2024-01-31 17:53:55.452000141 22.236733" - ] - }, - "execution_count": 68, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dist_to_patch_id_df" - ] - }, - { - "cell_type": "code", - "execution_count": 65, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'BAA-1104045': {'Patch1': array([-0.00000000e+00, -3.06814884e-03, -1.53407442e-03, ...,\n", - " 3.28233171e+03, 3.28233631e+03, 3.28232864e+03]),\n", - " 'Patch2': array([-0.00000000e+00, 1.53407442e-03, 4.60222326e-03, ...,\n", - " 5.53662799e+01, 5.53662799e+01, 5.53708821e+01]),\n", - " 'Patch3': array([-0.00000000e+00, -1.53407442e-03, -1.53407442e-03, ...,\n", - " 2.38928409e+03, 2.38928256e+03, 2.38927796e+03])},\n", - " '_ipython_display_': {},\n", - " '_repr_html_': {},\n", - " '_repr_javascript_': {},\n", - " '_repr_jpeg_': {},\n", - " '_repr_json_': {},\n", - " '_repr_latex_': {},\n", - " '_repr_markdown_': {},\n", - " '_repr_mimebundle_': {},\n", - " '_repr_pdf_': {},\n", - " '_repr_png_': {},\n", - " '_repr_svg_': {},\n", - " 'time': DatetimeIndex(['2024-01-31 16:18:07.001984119',\n", - " '2024-01-31 16:18:07.101984024',\n", - " '2024-01-31 16:18:07.201983929',\n", - " '2024-01-31 16:18:07.301983833',\n", - " '2024-01-31 16:18:07.401984215',\n", - " '2024-01-31 16:18:07.501984118',\n", - " '2024-01-31 16:18:07.601984024',\n", - " '2024-01-31 16:18:07.701983929',\n", - " '2024-01-31 16:18:07.801983833',\n", - " '2024-01-31 16:18:07.901984215',\n", - " ...\n", - " '2024-01-31 17:56:22.001984119',\n", - " '2024-01-31 17:56:22.101984024',\n", - " '2024-01-31 17:56:22.201983929',\n", - " '2024-01-31 17:56:22.301983833',\n", - " '2024-01-31 17:56:22.401984215',\n", - " '2024-01-31 17:56:22.501984118',\n", - " '2024-01-31 17:56:22.601984024',\n", - " '2024-01-31 17:56:22.701983929',\n", - " '2024-01-31 17:56:22.801983833',\n", - " '2024-01-31 17:56:22.901984215'],\n", - " dtype='datetime64[ns]', name='time', length=58960, freq=None)}\n" - ] - } - ], - "source": [ - "block.cum_wheel_dist.pprint()\n" - ] - }, - { - "cell_type": "code", - "execution_count": 60, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "14.142135623730951" - ] - }, - "execution_count": 60, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "np.sqrt(np.sum((patch_xy - (patch_xy + 10))**2))" - ] - }, - { - "cell_type": "code", - "execution_count": 212, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
xy
time
2024-01-31 16:18:07.059999943922.973083538.867432
2024-01-31 16:18:07.119999886923.023926538.851929
2024-01-31 16:18:07.179999828923.019226538.852417
2024-01-31 16:18:07.239999771922.998718538.848206
2024-01-31 16:18:07.300000191923.012939538.838379
.........
2024-01-31 17:56:22.6599998471109.742920872.181152
2024-01-31 17:56:22.7199997901104.848389875.274902
2024-01-31 17:56:22.7800002101096.728882885.990417
2024-01-31 17:56:22.8400001531086.006714896.699646
2024-01-31 17:56:22.9000000951075.127197910.000854
\n", - "

98177 rows × 2 columns

\n", - "
" - ], - "text/plain": [ - " x y\n", - "time \n", - "2024-01-31 16:18:07.059999943 922.973083 538.867432\n", - "2024-01-31 16:18:07.119999886 923.023926 538.851929\n", - "2024-01-31 16:18:07.179999828 923.019226 538.852417\n", - "2024-01-31 16:18:07.239999771 922.998718 538.848206\n", - "2024-01-31 16:18:07.300000191 923.012939 538.838379\n", - "... ... ...\n", - "2024-01-31 17:56:22.659999847 1109.742920 872.181152\n", - "2024-01-31 17:56:22.719999790 1104.848389 875.274902\n", - "2024-01-31 17:56:22.780000210 1096.728882 885.990417\n", - "2024-01-31 17:56:22.840000153 1086.006714 896.699646\n", - "2024-01-31 17:56:22.900000095 1075.127197 910.000854\n", - "\n", - "[98177 rows x 2 columns]" - ] - }, - "execution_count": 212, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Get part = centroid, return x,y as np.array\n", - "pose_df[pose_df[\"part\"] == \"centroid\"][[\"x\", \"y\"]]" - ] - }, - { - "cell_type": "code", - "execution_count": 221, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
timethresholdpatchid
02024-01-31 17:46:01.929984093166.161345Patch3BAA-1104045
12024-01-31 17:46:18.987999916201.563446Patch3BAA-1104045
22024-01-31 17:46:37.323999882148.860696Patch3BAA-1104045
32024-01-31 17:46:52.657983780155.151245Patch3BAA-1104045
42024-01-31 17:47:07.56198406285.592153Patch3BAA-1104045
52024-01-31 17:47:18.127999783132.567869Patch3BAA-1104045
62024-01-31 17:47:29.808000088148.151722Patch3BAA-1104045
72024-01-31 17:47:44.273983955118.466936Patch3BAA-1104045
82024-01-31 17:47:58.581984043104.584493Patch3BAA-1104045
92024-01-31 17:48:20.59999990588.933069Patch3BAA-1104045
102024-01-31 17:48:34.613984108405.436991Patch3BAA-1104045
112024-01-31 17:49:30.236000061194.962748Patch3BAA-1104045
122024-01-31 17:53:13.271999836156.343961Patch3BAA-1104045
132024-01-31 17:53:39.99398422290.257312Patch3BAA-1104045
142024-01-31 17:53:55.45200014182.164552Patch3BAA-1104045
\n", - "
" - ], - "text/plain": [ - " time threshold patch id\n", - "0 2024-01-31 17:46:01.929984093 166.161345 Patch3 BAA-1104045\n", - "1 2024-01-31 17:46:18.987999916 201.563446 Patch3 BAA-1104045\n", - "2 2024-01-31 17:46:37.323999882 148.860696 Patch3 BAA-1104045\n", - "3 2024-01-31 17:46:52.657983780 155.151245 Patch3 BAA-1104045\n", - "4 2024-01-31 17:47:07.561984062 85.592153 Patch3 BAA-1104045\n", - "5 2024-01-31 17:47:18.127999783 132.567869 Patch3 BAA-1104045\n", - "6 2024-01-31 17:47:29.808000088 148.151722 Patch3 BAA-1104045\n", - "7 2024-01-31 17:47:44.273983955 118.466936 Patch3 BAA-1104045\n", - "8 2024-01-31 17:47:58.581984043 104.584493 Patch3 BAA-1104045\n", - "9 2024-01-31 17:48:20.599999905 88.933069 Patch3 BAA-1104045\n", - "10 2024-01-31 17:48:34.613984108 405.436991 Patch3 BAA-1104045\n", - "11 2024-01-31 17:49:30.236000061 194.962748 Patch3 BAA-1104045\n", - "12 2024-01-31 17:53:13.271999836 156.343961 Patch3 BAA-1104045\n", - "13 2024-01-31 17:53:39.993984222 90.257312 Patch3 BAA-1104045\n", - "14 2024-01-31 17:53:55.452000141 82.164552 Patch3 BAA-1104045" - ] - }, - "execution_count": 221, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "patch_df_for_pellets_df" - ] - }, - { - "cell_type": "code", - "execution_count": 223, - "metadata": {}, - "outputs": [], - "source": [ - "dist_to_patch_id_df = pd.DataFrame(index=patch_df_for_pellets_df[\"time\"], columns=[subjects])" - ] - }, - { - "cell_type": "code", - "execution_count": 224, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
BAA-1104045
time
2024-01-31 17:46:01.929984093NaN
2024-01-31 17:46:18.987999916NaN
2024-01-31 17:46:37.323999882NaN
2024-01-31 17:46:52.657983780NaN
2024-01-31 17:47:07.561984062NaN
2024-01-31 17:47:18.127999783NaN
2024-01-31 17:47:29.808000088NaN
2024-01-31 17:47:44.273983955NaN
2024-01-31 17:47:58.581984043NaN
2024-01-31 17:48:20.599999905NaN
2024-01-31 17:48:34.613984108NaN
2024-01-31 17:49:30.236000061NaN
2024-01-31 17:53:13.271999836NaN
2024-01-31 17:53:39.993984222NaN
2024-01-31 17:53:55.452000141NaN
\n", - "
" - ], - "text/plain": [ - " BAA-1104045\n", - "time \n", - "2024-01-31 17:46:01.929984093 NaN\n", - "2024-01-31 17:46:18.987999916 NaN\n", - "2024-01-31 17:46:37.323999882 NaN\n", - "2024-01-31 17:46:52.657983780 NaN\n", - "2024-01-31 17:47:07.561984062 NaN\n", - "2024-01-31 17:47:18.127999783 NaN\n", - "2024-01-31 17:47:29.808000088 NaN\n", - "2024-01-31 17:47:44.273983955 NaN\n", - "2024-01-31 17:47:58.581984043 NaN\n", - "2024-01-31 17:48:20.599999905 NaN\n", - "2024-01-31 17:48:34.613984108 NaN\n", - "2024-01-31 17:49:30.236000061 NaN\n", - "2024-01-31 17:53:13.271999836 NaN\n", - "2024-01-31 17:53:39.993984222 NaN\n", - "2024-01-31 17:53:55.452000141 NaN" - ] - }, - "execution_count": 224, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dist_to_patch_id_df" - ] - }, - { - "cell_type": "code", - "execution_count": 231, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
classdist_to_patch
time
2024-01-31 16:18:07.059999943BAA-1104045384.666605
2024-01-31 16:18:07.119999886BAA-1104045384.703057
2024-01-31 16:18:07.179999828BAA-1104045384.699218
2024-01-31 16:18:07.239999771BAA-1104045384.679323
2024-01-31 16:18:07.300000191BAA-1104045384.686795
.........
2024-01-31 17:56:22.659999847BAA-1104045738.876897
2024-01-31 17:56:22.719999790BAA-1104045737.643805
2024-01-31 17:56:22.780000210BAA-1104045739.744758
2024-01-31 17:56:22.840000153BAA-1104045740.328964
2024-01-31 17:56:22.900000095BAA-1104045743.077797
\n", - "

98177 rows × 2 columns

\n", - "
" - ], - "text/plain": [ - " class dist_to_patch\n", - "time \n", - "2024-01-31 16:18:07.059999943 BAA-1104045 384.666605\n", - "2024-01-31 16:18:07.119999886 BAA-1104045 384.703057\n", - "2024-01-31 16:18:07.179999828 BAA-1104045 384.699218\n", - "2024-01-31 16:18:07.239999771 BAA-1104045 384.679323\n", - "2024-01-31 16:18:07.300000191 BAA-1104045 384.686795\n", - "... ... ...\n", - "2024-01-31 17:56:22.659999847 BAA-1104045 738.876897\n", - "2024-01-31 17:56:22.719999790 BAA-1104045 737.643805\n", - "2024-01-31 17:56:22.780000210 BAA-1104045 739.744758\n", - "2024-01-31 17:56:22.840000153 BAA-1104045 740.328964\n", - "2024-01-31 17:56:22.900000095 BAA-1104045 743.077797\n", - "\n", - "[98177 rows x 2 columns]" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
BAA-1104045
time
2024-01-31 17:46:01.929984093NaN
2024-01-31 17:46:18.987999916NaN
2024-01-31 17:46:37.323999882NaN
2024-01-31 17:46:52.657983780NaN
2024-01-31 17:47:07.561984062NaN
2024-01-31 17:47:18.127999783NaN
2024-01-31 17:47:29.808000088NaN
2024-01-31 17:47:44.273983955NaN
2024-01-31 17:47:58.581984043NaN
2024-01-31 17:48:20.599999905NaN
2024-01-31 17:48:34.613984108NaN
2024-01-31 17:49:30.236000061NaN
2024-01-31 17:53:13.271999836NaN
2024-01-31 17:53:39.993984222NaN
2024-01-31 17:53:55.452000141NaN
\n", - "
" - ], - "text/plain": [ - " BAA-1104045\n", - "time \n", - "2024-01-31 17:46:01.929984093 NaN\n", - "2024-01-31 17:46:18.987999916 NaN\n", - "2024-01-31 17:46:37.323999882 NaN\n", - "2024-01-31 17:46:52.657983780 NaN\n", - "2024-01-31 17:47:07.561984062 NaN\n", - "2024-01-31 17:47:18.127999783 NaN\n", - "2024-01-31 17:47:29.808000088 NaN\n", - "2024-01-31 17:47:44.273983955 NaN\n", - "2024-01-31 17:47:58.581984043 NaN\n", - "2024-01-31 17:48:20.599999905 NaN\n", - "2024-01-31 17:48:34.613984108 NaN\n", - "2024-01-31 17:49:30.236000061 NaN\n", - "2024-01-31 17:53:13.271999836 NaN\n", - "2024-01-31 17:53:39.993984222 NaN\n", - "2024-01-31 17:53:55.452000141 NaN" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "patch_xy = np.array(patch_locs[patch][arena]).astype(np.uint32)\n", - "subjects_xy = pose_df[pose_df[\"part\"] == \"centroid\"][[\"x\", \"y\"]].values\n", - "dist_to_patch = np.sqrt(np.sum((subjects_xy - patch_xy) ** 2, axis=1))\n", - "dist_to_patch_df = pose_df[[\"class\"]].copy()\n", - "dist_to_patch_df[\"dist_to_patch\"] = dist_to_patch\n", - "dist_to_patch_id_df = pd.DataFrame(index=patch_df_for_pellets_df[\"time\"], columns=[subjects])\n", - "display(dist_to_patch_df)\n", - "display(dist_to_patch_id_df)" - ] - }, - { - "cell_type": "code", - "execution_count": 238, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
(BAA-1104045,)classdist_to_patch
time
2024-01-31 17:46:01.929984093NaNBAA-110404519.174071
2024-01-31 17:46:18.987999916NaNBAA-110404515.551528
2024-01-31 17:46:37.323999882NaNBAA-110404519.905172
2024-01-31 17:46:52.657983780NaNBAA-110404519.984235
2024-01-31 17:47:07.561984062NaNBAA-110404521.056611
2024-01-31 17:47:18.127999783NaNBAA-110404517.622595
2024-01-31 17:47:29.808000088NaNBAA-110404519.765585
2024-01-31 17:47:44.273983955NaNBAA-110404517.342467
2024-01-31 17:47:58.581984043NaNBAA-110404521.922041
2024-01-31 17:48:20.599999905NaNBAA-110404518.808438
2024-01-31 17:48:34.613984108NaNBAA-110404520.958044
2024-01-31 17:49:30.236000061NaNBAA-110404521.401976
2024-01-31 17:53:13.271999836NaNBAA-110404519.659521
2024-01-31 17:53:39.993984222NaNBAA-110404521.454221
2024-01-31 17:53:55.452000141NaNBAA-110404522.236733
\n", - "
" - ], - "text/plain": [ - " (BAA-1104045,) class dist_to_patch\n", - "time \n", - "2024-01-31 17:46:01.929984093 NaN BAA-1104045 19.174071\n", - "2024-01-31 17:46:18.987999916 NaN BAA-1104045 15.551528\n", - "2024-01-31 17:46:37.323999882 NaN BAA-1104045 19.905172\n", - "2024-01-31 17:46:52.657983780 NaN BAA-1104045 19.984235\n", - "2024-01-31 17:47:07.561984062 NaN BAA-1104045 21.056611\n", - "2024-01-31 17:47:18.127999783 NaN BAA-1104045 17.622595\n", - "2024-01-31 17:47:29.808000088 NaN BAA-1104045 19.765585\n", - "2024-01-31 17:47:44.273983955 NaN BAA-1104045 17.342467\n", - "2024-01-31 17:47:58.581984043 NaN BAA-1104045 21.922041\n", - "2024-01-31 17:48:20.599999905 NaN BAA-1104045 18.808438\n", - "2024-01-31 17:48:34.613984108 NaN BAA-1104045 20.958044\n", - "2024-01-31 17:49:30.236000061 NaN BAA-1104045 21.401976\n", - "2024-01-31 17:53:13.271999836 NaN BAA-1104045 19.659521\n", - "2024-01-31 17:53:39.993984222 NaN BAA-1104045 21.454221\n", - "2024-01-31 17:53:55.452000141 NaN BAA-1104045 22.236733" - ] - }, - "execution_count": 238, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "pd.merge_asof(dist_to_patch_id_df, dist_to_patch_df, left_index=True, right_index=True, direction=\"forward\", tolerance=pd.Timedelta(\"200ms\"))" - ] - }, - { - "cell_type": "code", - "execution_count": 240, - "metadata": {}, - "outputs": [], - "source": [ - " patch_xy = np.array(patch_locs[patch][arena]).astype(np.uint32)\n", - " subjects_xy = pose_df[pose_df[\"part\"] == \"centroid\"][[\"x\", \"y\"]].values\n", - " dist_to_patch = np.sqrt(np.sum((subjects_xy - patch_xy) ** 2, axis=1))\n", - " dist_to_patch_df = pose_df[[\"class\"]].copy()\n", - " dist_to_patch_df[\"dist_to_patch\"] = dist_to_patch\n", - " dist_to_patch_id_df = pd.DataFrame(index=patch_df_for_pellets_df[\"time\"], columns=subjects)\n", - " for subject in subjects:\n", - " # Find closest match between dist_to_patch_id_df indices and pose_df indices\n", - " dist_to_patch_subj = pd.merge_asof(\n", - " left=dist_to_patch_id_df, \n", - " right=dist_to_patch_df,\n", - " left_index=True,\n", - " right_index=True, \n", - " direction=\"forward\", \n", - " tolerance=pd.Timedelta(\"200ms\")\n", - " )\n", - " dist_to_patch_id_df[subject] = dist_to_patch_subj[\"dist_to_patch\"]" - ] - }, - { - "cell_type": "code", - "execution_count": 248, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", "
BAA-1104045BAA-1104047
time
2024-01-31 17:46:01.92998409319.17407120.174071
2024-01-31 17:46:18.98799991615.55152814.551528
2024-01-31 17:46:37.32399988219.90517220.905172
2024-01-31 17:46:52.65798378019.98423518.984235
2024-01-31 17:47:07.56198406221.05661122.056611
2024-01-31 17:47:18.12799978317.62259516.622595
2024-01-31 17:47:29.80800008819.76558520.765585
2024-01-31 17:47:44.27398395517.34246716.342467
2024-01-31 17:47:58.58198404321.92204122.9220412024-02-13 15:17:16.401984215-0.0030680.000000
2024-01-31 17:48:20.59999990518.80843817.808438.........
2024-01-31 17:48:34.61398410820.95804421.9580442024-02-13 18:03:14.5019841181878.110552531.869738
2024-01-31 17:49:30.23600006121.40197620.4019762024-02-13 18:03:14.6019840241878.104416531.869738
2024-01-31 17:53:13.27199983619.65952120.6595212024-02-13 18:03:14.7019839291878.110552531.869738
2024-01-31 17:53:39.99398422221.45422120.4542212024-02-13 18:03:14.8019838331878.102882531.869738
2024-01-31 17:53:55.45200014122.23673323.2367332024-02-13 18:03:14.9019842151878.109018531.869738
\n", + "

99590 rows × 2 columns

\n", "
" ], "text/plain": [ " BAA-1104045 BAA-1104047\n", "time \n", - "2024-01-31 17:46:01.929984093 19.174071 20.174071\n", - "2024-01-31 17:46:18.987999916 15.551528 14.551528\n", - "2024-01-31 17:46:37.323999882 19.905172 20.905172\n", - "2024-01-31 17:46:52.657983780 19.984235 18.984235\n", - "2024-01-31 17:47:07.561984062 21.056611 22.056611\n", - "2024-01-31 17:47:18.127999783 17.622595 16.622595\n", - "2024-01-31 17:47:29.808000088 19.765585 20.765585\n", - "2024-01-31 17:47:44.273983955 17.342467 16.342467\n", - "2024-01-31 17:47:58.581984043 21.922041 22.922041\n", - "2024-01-31 17:48:20.599999905 18.808438 17.808438\n", - "2024-01-31 17:48:34.613984108 20.958044 21.958044\n", - "2024-01-31 17:49:30.236000061 21.401976 20.401976\n", - "2024-01-31 17:53:13.271999836 19.659521 20.659521\n", - "2024-01-31 17:53:39.993984222 21.454221 20.454221\n", - "2024-01-31 17:53:55.452000141 22.236733 23.236733" + "2024-02-13 15:17:16.001984119 -0.000000 0.000000\n", + "2024-02-13 15:17:16.101984024 -0.006136 0.000000\n", + "2024-02-13 15:17:16.201983929 0.001534 0.000000\n", + "2024-02-13 15:17:16.301983833 0.000000 0.000000\n", + "2024-02-13 15:17:16.401984215 -0.003068 0.000000\n", + "... ... ...\n", + "2024-02-13 18:03:14.501984118 1878.110552 531.869738\n", + "2024-02-13 18:03:14.601984024 1878.104416 531.869738\n", + "2024-02-13 18:03:14.701983929 1878.110552 531.869738\n", + "2024-02-13 18:03:14.801983833 1878.102882 531.869738\n", + "2024-02-13 18:03:14.901984215 1878.109018 531.869738\n", + "\n", + "[99590 rows x 2 columns]" ] }, - "execution_count": 248, "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dist_to_patch_id_df[\"BAA-1104047\"] = dist_to_patch_id_df[\"BAA-1104045\"]\n", - "dist_to_patch_id_df[\"BAA-1104047\"] -= 1\n", - "dist_to_patch_id_df[\"BAA-1104047\"].iloc[::2] += 2\n", - "dist_to_patch_id_df" - ] - }, - { - "cell_type": "code", - "execution_count": 251, - "metadata": {}, - "outputs": [ + "output_type": "display_data" + }, { - "data": { - "text/plain": [ - "array(['BAA-1104045', 'BAA-1104047', 'BAA-1104045', 'BAA-1104047',\n", - " 'BAA-1104045', 'BAA-1104047', 'BAA-1104045', 'BAA-1104047',\n", - " 'BAA-1104045', 'BAA-1104047', 'BAA-1104045', 'BAA-1104047',\n", - " 'BAA-1104045', 'BAA-1104047', 'BAA-1104045'], dtype=object)" - ] - }, - "execution_count": 251, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dist_to_patch_id_df.idxmin(axis=1).values" - ] - }, - { - "cell_type": "code", - "execution_count": 252, - "metadata": {}, - "outputs": [], - "source": [ - "patch_df_for_pellets_df[\"id\"] = dist_to_patch_id_df.idxmin(axis=1).values" - ] - }, - { - "cell_type": "code", - "execution_count": 253, - "metadata": {}, - "outputs": [ + "name": "stdout", + "output_type": "stream", + "text": [ + "Subject cum wheel dist for patch='Patch2'\n" + ] + }, { "data": { "text/html": [ @@ -5024,155 +808,104 @@ " \n", " \n", " \n", + " BAA-1104045\n", + " BAA-1104047\n", + " \n", + " \n", " time\n", - " threshold\n", - " patch\n", - " id\n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " 0\n", - " 2024-01-31 17:46:01.929984093\n", - " 166.161345\n", - " Patch3\n", - " BAA-1104045\n", - " \n", - " \n", - " 1\n", - " 2024-01-31 17:46:18.987999916\n", - " 201.563446\n", - " Patch3\n", - " BAA-1104047\n", - " \n", - " \n", - " 2\n", - " 2024-01-31 17:46:37.323999882\n", - " 148.860696\n", - " Patch3\n", - " BAA-1104045\n", - " \n", - " \n", - " 3\n", - " 2024-01-31 17:46:52.657983780\n", - " 155.151245\n", - " Patch3\n", - " BAA-1104047\n", - " \n", - " \n", - " 4\n", - " 2024-01-31 17:47:07.561984062\n", - " 85.592153\n", - " Patch3\n", - " BAA-1104045\n", + " 2024-02-13 15:17:16.001984119\n", + " 0.000000\n", + " -0.000000\n", " \n", " \n", - " 5\n", - " 2024-01-31 17:47:18.127999783\n", - " 132.567869\n", - " Patch3\n", - " BAA-1104047\n", + " 2024-02-13 15:17:16.101984024\n", + " 0.000000\n", + " 0.000000\n", " \n", " \n", - " 6\n", - " 2024-01-31 17:47:29.808000088\n", - " 148.151722\n", - " Patch3\n", - " BAA-1104045\n", + " 2024-02-13 15:17:16.201983929\n", + " 0.000000\n", + " 0.000000\n", " \n", " \n", - " 7\n", - " 2024-01-31 17:47:44.273983955\n", - " 118.466936\n", - " Patch3\n", - " BAA-1104047\n", + " 2024-02-13 15:17:16.301983833\n", + " 0.000000\n", + " -0.007670\n", " \n", " \n", - " 8\n", - " 2024-01-31 17:47:58.581984043\n", - " 104.584493\n", - " Patch3\n", - " BAA-1104045\n", + " 2024-02-13 15:17:16.401984215\n", + " 0.000000\n", + " -0.006136\n", " \n", " \n", - " 9\n", - " 2024-01-31 17:48:20.599999905\n", - " 88.933069\n", - " Patch3\n", - " BAA-1104047\n", + " ...\n", + " ...\n", + " ...\n", " \n", " \n", - " 10\n", - " 2024-01-31 17:48:34.613984108\n", - " 405.436991\n", - " Patch3\n", - " BAA-1104045\n", + " 2024-02-13 18:03:14.501984118\n", + " 6166.591049\n", + " 12448.501540\n", " \n", " \n", - " 11\n", - " 2024-01-31 17:49:30.236000061\n", - " 194.962748\n", - " Patch3\n", - " BAA-1104047\n", + " 2024-02-13 18:03:14.601984024\n", + " 6166.591049\n", + " 12448.498472\n", " \n", " \n", - " 12\n", - " 2024-01-31 17:53:13.271999836\n", - " 156.343961\n", - " Patch3\n", - " BAA-1104045\n", + " 2024-02-13 18:03:14.701983929\n", + " 6166.591049\n", + " 12448.500006\n", " \n", " \n", - " 13\n", - " 2024-01-31 17:53:39.993984222\n", - " 90.257312\n", - " Patch3\n", - " BAA-1104047\n", + " 2024-02-13 18:03:14.801983833\n", + " 6166.591049\n", + " 12448.498472\n", " \n", " \n", - " 14\n", - " 2024-01-31 17:53:55.452000141\n", - " 82.164552\n", - " Patch3\n", - " BAA-1104045\n", + " 2024-02-13 18:03:14.901984215\n", + " 6166.594117\n", + " 12448.498472\n", " \n", " \n", "\n", + "

99590 rows × 2 columns

\n", "" ], "text/plain": [ - " time threshold patch id\n", - "0 2024-01-31 17:46:01.929984093 166.161345 Patch3 BAA-1104045\n", - "1 2024-01-31 17:46:18.987999916 201.563446 Patch3 BAA-1104047\n", - "2 2024-01-31 17:46:37.323999882 148.860696 Patch3 BAA-1104045\n", - "3 2024-01-31 17:46:52.657983780 155.151245 Patch3 BAA-1104047\n", - "4 2024-01-31 17:47:07.561984062 85.592153 Patch3 BAA-1104045\n", - "5 2024-01-31 17:47:18.127999783 132.567869 Patch3 BAA-1104047\n", - "6 2024-01-31 17:47:29.808000088 148.151722 Patch3 BAA-1104045\n", - "7 2024-01-31 17:47:44.273983955 118.466936 Patch3 BAA-1104047\n", - "8 2024-01-31 17:47:58.581984043 104.584493 Patch3 BAA-1104045\n", - "9 2024-01-31 17:48:20.599999905 88.933069 Patch3 BAA-1104047\n", - "10 2024-01-31 17:48:34.613984108 405.436991 Patch3 BAA-1104045\n", - "11 2024-01-31 17:49:30.236000061 194.962748 Patch3 BAA-1104047\n", - "12 2024-01-31 17:53:13.271999836 156.343961 Patch3 BAA-1104045\n", - "13 2024-01-31 17:53:39.993984222 90.257312 Patch3 BAA-1104047\n", - "14 2024-01-31 17:53:55.452000141 82.164552 Patch3 BAA-1104045" + " BAA-1104045 BAA-1104047\n", + "time \n", + "2024-02-13 15:17:16.001984119 0.000000 -0.000000\n", + "2024-02-13 15:17:16.101984024 0.000000 0.000000\n", + "2024-02-13 15:17:16.201983929 0.000000 0.000000\n", + "2024-02-13 15:17:16.301983833 0.000000 -0.007670\n", + "2024-02-13 15:17:16.401984215 0.000000 -0.006136\n", + "... ... ...\n", + "2024-02-13 18:03:14.501984118 6166.591049 12448.501540\n", + "2024-02-13 18:03:14.601984024 6166.591049 12448.498472\n", + "2024-02-13 18:03:14.701983929 6166.591049 12448.500006\n", + "2024-02-13 18:03:14.801983833 6166.591049 12448.498472\n", + "2024-02-13 18:03:14.901984215 6166.594117 12448.498472\n", + "\n", + "[99590 rows x 2 columns]" ] }, - "execution_count": 253, "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "patch_df_for_pellets_df" - ] - }, - { - "cell_type": "code", - "execution_count": 166, - "metadata": {}, - "outputs": [ + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Subject cum wheel dist for patch='Patch3'\n" + ] + }, { "data": { "text/html": [ @@ -5194,277 +927,111 @@ " \n", " \n", " \n", - " threshold\n", - " offset\n", - " rate\n", + " BAA-1104045\n", + " BAA-1104047\n", " \n", " \n", " time\n", " \n", " \n", - " \n", " \n", " \n", " \n", " \n", - " 2024-02-14 08:02:06.921984196\n", - " 115.006748\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:02:19.219999790\n", - " 361.785049\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:02:43.841983795\n", - " 194.950509\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:05:23.169983864\n", - " 88.046672\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:11:36.375999928\n", - " 85.945754\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:13:55.437983990\n", - " 76.270649\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:14:07.480000019\n", - " 205.543520\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:16:26.765984058\n", - " 88.423802\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:19:22.361983776\n", - " 96.462577\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:19:33.853983879\n", - " 132.625352\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:22:26.412000179\n", - " 372.380471\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:23:13.721983910\n", - " 88.550613\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:23:57.768000126\n", - " 158.293375\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:24:20.101984024\n", - " 94.946606\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:24:40.705984116\n", - " 128.350386\n", - " 75\n", - " 0.01\n", - " \n", - " \n", - " 2024-02-14 08:26:23.029983997\n", - " 103.003226\n", - " 75\n", - " 0.01\n", + " 2024-02-13 15:17:16.001984119\n", + " 0.000000\n", + " -0.000000\n", " \n", " \n", - " 2024-02-14 08:29:16.335999966\n", - " 439.736339\n", - " 75\n", - " 0.01\n", + " 2024-02-13 15:17:16.101984024\n", + " 0.000000\n", + " 0.003068\n", " \n", " \n", - " 2024-02-14 08:34:36.980000019\n", - " 241.119074\n", - " 75\n", - " 0.01\n", + " 2024-02-13 15:17:16.201983929\n", + " 0.000000\n", + " 0.006136\n", " \n", " \n", - " 2024-02-14 08:35:02.955999851\n", - " 209.483334\n", - " 75\n", - " 0.01\n", + " 2024-02-13 15:17:16.301983833\n", + " 0.000000\n", + " 0.003068\n", " \n", " \n", - " 2024-02-14 08:42:52.768000126\n", - " 169.083744\n", - " 75\n", - " 0.01\n", + " 2024-02-13 15:17:16.401984215\n", + " 0.000000\n", + " 0.003068\n", " \n", " \n", - " 2024-02-14 08:43:12.713984013\n", - " 146.062839\n", - " 75\n", - " 0.01\n", + " ...\n", + " ...\n", + " ...\n", " \n", " \n", - " 2024-02-14 08:45:27.196000099\n", - " 88.638738\n", - " 75\n", - " 0.01\n", + " 2024-02-13 18:03:14.501984118\n", + " 408.296975\n", + " 369.892956\n", " \n", " \n", - " 2024-02-14 08:45:37.736000061\n", - " 80.205599\n", - " 75\n", - " 0.01\n", + " 2024-02-13 18:03:14.601984024\n", + " 408.295441\n", + " 369.892956\n", " \n", " \n", - " 2024-02-14 08:46:39.001984119\n", - " NaN\n", - " 75\n", - " 0.01\n", + " 2024-02-13 18:03:14.701983929\n", + " 408.300043\n", + " 369.892956\n", " \n", " \n", - " 2024-02-14 08:46:39.004000186\n", - " NaN\n", - " 75\n", - " 0.01\n", + " 2024-02-13 18:03:14.801983833\n", + " 408.296975\n", + " 369.892956\n", " \n", " \n", - " 2024-02-14 08:46:39.004000186\n", - " 205.907633\n", - " 75\n", - " 0.01\n", + " 2024-02-13 18:03:14.901984215\n", + " 408.298509\n", + " 369.892956\n", " \n", " \n", "\n", + "

99590 rows × 2 columns

\n", "" ], "text/plain": [ - " threshold offset rate\n", + " BAA-1104045 BAA-1104047\n", "time \n", - "2024-02-14 08:02:06.921984196 115.006748 75 0.01\n", - "2024-02-14 08:02:19.219999790 361.785049 75 0.01\n", - "2024-02-14 08:02:43.841983795 194.950509 75 0.01\n", - "2024-02-14 08:05:23.169983864 88.046672 75 0.01\n", - "2024-02-14 08:11:36.375999928 85.945754 75 0.01\n", - "2024-02-14 08:13:55.437983990 76.270649 75 0.01\n", - "2024-02-14 08:14:07.480000019 205.543520 75 0.01\n", - "2024-02-14 08:16:26.765984058 88.423802 75 0.01\n", - "2024-02-14 08:19:22.361983776 96.462577 75 0.01\n", - "2024-02-14 08:19:33.853983879 132.625352 75 0.01\n", - "2024-02-14 08:22:26.412000179 372.380471 75 0.01\n", - "2024-02-14 08:23:13.721983910 88.550613 75 0.01\n", - "2024-02-14 08:23:57.768000126 158.293375 75 0.01\n", - "2024-02-14 08:24:20.101984024 94.946606 75 0.01\n", - "2024-02-14 08:24:40.705984116 128.350386 75 0.01\n", - "2024-02-14 08:26:23.029983997 103.003226 75 0.01\n", - "2024-02-14 08:29:16.335999966 439.736339 75 0.01\n", - "2024-02-14 08:34:36.980000019 241.119074 75 0.01\n", - "2024-02-14 08:35:02.955999851 209.483334 75 0.01\n", - "2024-02-14 08:42:52.768000126 169.083744 75 0.01\n", - "2024-02-14 08:43:12.713984013 146.062839 75 0.01\n", - "2024-02-14 08:45:27.196000099 88.638738 75 0.01\n", - "2024-02-14 08:45:37.736000061 80.205599 75 0.01\n", - "2024-02-14 08:46:39.001984119 NaN 75 0.01\n", - "2024-02-14 08:46:39.004000186 NaN 75 0.01\n", - "2024-02-14 08:46:39.004000186 205.907633 75 0.01" - ] - }, - "execution_count": 166, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "patch_df" - ] - }, - { - "cell_type": "code", - "execution_count": 167, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "23" - ] - }, - "execution_count": 167, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sum(np.diff(patch_df.index) > pd.Timedelta(\"1s\"))" - ] - }, - { - "cell_type": "code", - "execution_count": 218, - "metadata": {}, - "outputs": [], - "source": [ - " patch_xy = np.array(patch_locs[patch][arena]).astype(np.uint32)\n", - " subjects_xy = pose_df[pose_df[\"part\"] == \"centroid\"][[\"x\", \"y\"]].values\n", - " dist_to_patch = np.sqrt(np.sum((subjects_xy - patch_xy) ** 2, axis=1))" - ] - }, - { - "cell_type": "code", - "execution_count": 219, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([384.66660495, 384.70305651, 384.69921817, ..., 739.74475784,\n", - " 740.32896414, 743.07779698])" + "2024-02-13 15:17:16.001984119 0.000000 -0.000000\n", + "2024-02-13 15:17:16.101984024 0.000000 0.003068\n", + "2024-02-13 15:17:16.201983929 0.000000 0.006136\n", + "2024-02-13 15:17:16.301983833 0.000000 0.003068\n", + "2024-02-13 15:17:16.401984215 0.000000 0.003068\n", + "... ... ...\n", + "2024-02-13 18:03:14.501984118 408.296975 369.892956\n", + "2024-02-13 18:03:14.601984024 408.295441 369.892956\n", + "2024-02-13 18:03:14.701983929 408.300043 369.892956\n", + "2024-02-13 18:03:14.801983833 408.296975 369.892956\n", + "2024-02-13 18:03:14.901984215 408.298509 369.892956\n", + "\n", + "[99590 rows x 2 columns]" ] }, - "execution_count": 219, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" } ], "source": [ - "dist_to_patch" + "display(block.patch_info)\n", + "\n", + "for patch in patches:\n", + " print(f\"Subject cum wheel dist for {patch=}\")\n", + " display(block.cum_wheel_dist[patch])\n" ] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "np.convolve([1, 2, 3, 4, 5], [1, 1, 1])" + "---" ] }, { @@ -5476,38 +1043,6 @@ "# NOPE" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Date: Wed, 14 Feb 2024 16:23:44 +0000 Subject: [PATCH 10/14] moved notebook to docs --- .../examples/social02_block_analysis.ipynb | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename social01_block_analysis.ipynb => docs/examples/social02_block_analysis.ipynb (100%) diff --git a/social01_block_analysis.ipynb b/docs/examples/social02_block_analysis.ipynb similarity index 100% rename from social01_block_analysis.ipynb rename to docs/examples/social02_block_analysis.ipynb From 6bbf429c789624f22fa3a396f7a7a3d783ce987e Mon Sep 17 00:00:00 2001 From: Jai Date: Wed, 14 Feb 2024 16:26:10 +0000 Subject: [PATCH 11/14] cleaned up output --- docs/examples/social02_block_analysis.ipynb | 126 ++------------------ 1 file changed, 9 insertions(+), 117 deletions(-) diff --git a/docs/examples/social02_block_analysis.ipynb b/docs/examples/social02_block_analysis.ipynb index f0e381e2..0589ea17 100644 --- a/docs/examples/social02_block_analysis.ipynb +++ b/docs/examples/social02_block_analysis.ipynb @@ -1133,138 +1133,30 @@ "source": [] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "# wboth_quantized[i]].index[0] - pd.Timedelta(\"1s\")\n", - " if (epoch_ts_post > safe_change_ts) and not epoch_thresh_change_idx:\n", - " epoch_thresh_change_idx = i\n", - " weasy_post = weasy[weasy.index > epoch_ts_post][0]\n", - " whard_post = whard[whard.index > epoch_ts_post][0]\n", - " weasy_pre = weasy[weasy.index > epoch_ts_pre][0]\n", - " whard_pre = whard[whard.index > epoch_ts_pre][0]\n", - " weasy_diff = weasy_post - weasy_pre\n", - " whard_diff = whard_post - whard_pre\n", - " easy_pref_epoch_cum[i] = weasy_post / (weasy_post + whard_post)\n", - " easy_pref_epoch[i] = weasy_diff / (weasy_diff + whard_diff)\n", - " epoch_ts_pre = epoch_ts_post\n", - "sessions.at[s.Index, \"easy_pref_epoch_cum\"] = easy_pref_epoch_cum\n", - "sessions.at[s.Index, \"easy_pref_epoch\"] = easy_pref_epoch\n", - "sessions.loc[s.Index, \"epoch_thresh_change_idx\"] = epoch_thresh_change_idx\n", - "# /ss>\n", - "# w_chunk_dist)[0][0]\n", - "end_idxs = np.arange(pref_first_idx, n_samples, 1).astype(int)\n", - "start_idxs = np.zeros((len(end_idxs),)).astype(int)\n", - "for i, idx in enumerate(end_idxs):\n", - " start_idxs[i] = np.where((w_all_chnkd_cumsum[0:idx] + w_chunk_dist) > w_all_chnkd_cumsum[idx])[0][0]\n", - "# /sss>\n", - "# \n", - "# 0.1, whard_chnkd_gen > 0.1))[0]\n", - " for ii in impossible_idxs:\n", - " if weasy_chnkd_gen[ii] > whard_chnkd_gen[ii]:\n", - " whard_chnkd_gen[ii] = 0\n", - " else:\n", - " weasy_chnkd_gen[ii] = 0\n", - " weasy_chnkd_gen_cumsum = weasy_chnkd_gen.cumsum()\n", - " whard_chnkd_gen_cumsum = whard_chnkd_gen.cumsum()\n", - " w_all_chnkd_gen_cumsum = weasy_chnkd_gen_cumsum + whard_chnkd_gen_cumsum\n", - " # Get synthetic patch pref\n", - " end_idxs = np.arange(pref_first_idx, n_samples, 1).astype(int)\n", - " start_idxs = np.zeros((len(end_idxs),)).astype(int)\n", - " for i, idx in enumerate(end_idxs):\n", - " start_idxs[i] = np.where(\n", - " (w_all_chnkd_gen_cumsum[0:idx] + w_chunk_dist) \n", - " > w_all_chnkd_gen_cumsum[idx]\n", - " )[0][0]\n", - " weasy_diff_gen = weasy_chnkd_gen_cumsum[end_idxs] - weasy_chnkd_gen_cumsum[start_idxs]\n", - " whard_diff_gen = whard_chnkd_gen_cumsum[end_idxs] - whard_chnkd_gen_cumsum[start_idxs]\n", - " weasy_pref_gen = weasy_diff_gen / (weasy_diff_gen + whard_diff_gen)\n", - " syn_chunk_pref_dists[distri_n, :] = weasy_pref_gen\n", - "# /sss>\n", - "# \n", - "# high_bound)[0]\n", - "# For each pref_idx, find the first earlier idx with `pref_window` less\n", - "# cum distance, then see if pref over this window is > `pref_thresh`\n", - "for pref_start_idx in pref_idxs:\n", - " pref_end_idx = np.where(\n", - " w_all_chnkd_cumsum[pref_start_idx:] \n", - " > (w_all_chnkd_cumsum[pref_start_idx] + pref_window)\n", - " )[0]\n", - " if pref_end_idx.size > 0:\n", - " pref_end_idx = pref_end_idx[0] + pref_start_idx\n", - " pref_p = np.sum(\n", - " weasy_pref[pref_start_idx : pref_end_idx] \n", - " > high_bound[pref_start_idx : pref_end_idx]\n", - " ) / (pref_end_idx - pref_start_idx)\n", - " if pref_p > pref_thresh:\n", - " learned_start_idx = pref_start_idx\n", - " learned_end_idx = pref_end_idx\n", - " break\n", - "# /sss>\n", - "cont_patch_pref = DotMap(\n", - " w_all_chnkd_cumsum=w_all_chnkd_cumsum.astype('float32'),\n", - " weasy_pref=weasy_pref.astype('float32'),\n", - " low_bound=low_bound.astype('float32'),\n", - " high_bound=high_bound.astype('float32'),\n", - " learned_start_idx=learned_start_idx,\n", - " learned_end_idx=learned_end_idx,\n", - " thresh_change_idx=(safe_change_ts - s.enter).seconds\n", - ")\n", - "sessions.at[s.Index, \"cont_patch_pref\"] = cont_patch_pref\n", - "if learned_start_idx:\n", - " print(f\"Learned: {s.id} {s.enter} ... {post_easy_rate} {post_hard_rate}\")\n", - "# /ss> /s>" + "## Research Questions" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Questions" + "- In a block, what percentage of time do they end on easy block?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "- In a block, what percentage of time do they end on easy block?" + "## Usage Questions" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] } ], "metadata": { From 6f79e184816e60be073f65040eae2b2742f73631 Mon Sep 17 00:00:00 2001 From: Jai Date: Wed, 14 Feb 2024 16:30:39 +0000 Subject: [PATCH 12/14] cleaned up cells output --- docs/examples/social02_block_analysis.ipynb | 441 +++++++++++++++++++- 1 file changed, 430 insertions(+), 11 deletions(-) diff --git a/docs/examples/social02_block_analysis.ipynb b/docs/examples/social02_block_analysis.ipynb index 0589ea17..1039bb4d 100644 --- a/docs/examples/social02_block_analysis.ipynb +++ b/docs/examples/social02_block_analysis.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -201,9 +201,257 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\3226657415.py:41: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " if block_info.pellet_ct[i - 1] > 0:\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\3226657415.py:43: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " elif block_info.pellet_ct[i - 1] == 0 and block_info.index[i] - block_info.index[i - 1] > pd.Timedelta(\"1s\"):\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:139: FutureWarning: The behavior of array concatenation with empty entries is deprecated. In a future version, this will no longer exclude empty items when determining the result dtype. To retain the old behavior, exclude the empty entries before the concat operation.\n", + " data = pd.concat([reader.read(file) for _, file in files])\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:139: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " data = pd.concat([reader.read(file) for _, file in files])\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\3226657415.py:41: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " if block_info.pellet_ct[i - 1] > 0:\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\3226657415.py:43: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " elif block_info.pellet_ct[i - 1] == 0 and block_info.index[i] - block_info.index[i - 1] > pd.Timedelta(\"1s\"):\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
rootsleap_model_dirstartendblock_durationsubjectspatch_infopellet_infocum_wheel_dist
0Z:\\aeon\\data\\raw\\AEON4\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...2024-01-31 12:59:06.0059838292024-01-31 14:58:11.045983791NoneNoneNoneNoneNone
1Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-01-31 12:59:14.0019841192024-01-31 14:45:59.000000000NoneNoneNoneNoneNone
2Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-01-31 14:45:55.0000000002024-01-31 16:18:11.001984119NoneNoneNoneNoneNone
3Z:\\aeon\\data\\raw\\AEON4\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...2024-01-31 14:58:07.0459837912024-01-31 17:49:26.000000000NoneNoneNoneNoneNone
4Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-01-31 16:18:07.0019841192024-01-31 17:56:23.000000000NoneNoneNoneNoneNone
..............................
288Z:\\aeon\\data\\raw\\AEON4\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...2024-02-14 08:09:54.0279998782024-02-14 10:30:10.001984119NoneNoneNoneNoneNone
289Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-02-14 08:46:37.0000000002024-02-14 10:17:35.015999794NoneNoneNoneNoneNone
290Z:\\aeon\\data\\raw\\AEON3\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...2024-02-14 10:17:31.0159997942024-02-14 12:55:24.004000186NoneNoneNoneNoneNone
291Z:\\aeon\\data\\raw\\AEON4\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...2024-02-14 10:30:06.0019841192024-02-14 13:14:25.005983829NoneNoneNoneNoneNone
292Z:\\aeon\\data\\raw\\AEON4\\social0.2Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...2024-02-14 13:14:21.0059838292024-02-14 14:20:22.001984119NoneNoneNoneNoneNone
\n", + "

293 rows × 9 columns

\n", + "
" + ], + "text/plain": [ + " root \\\n", + "0 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", + "1 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", + "2 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", + "3 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", + "4 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", + ".. ... \n", + "288 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", + "289 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", + "290 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", + "291 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", + "292 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", + "\n", + " sleap_model_dir \\\n", + "0 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", + "1 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", + "2 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", + "3 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", + "4 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", + ".. ... \n", + "288 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", + "289 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", + "290 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", + "291 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", + "292 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", + "\n", + " start end \\\n", + "0 2024-01-31 12:59:06.005983829 2024-01-31 14:58:11.045983791 \n", + "1 2024-01-31 12:59:14.001984119 2024-01-31 14:45:59.000000000 \n", + "2 2024-01-31 14:45:55.000000000 2024-01-31 16:18:11.001984119 \n", + "3 2024-01-31 14:58:07.045983791 2024-01-31 17:49:26.000000000 \n", + "4 2024-01-31 16:18:07.001984119 2024-01-31 17:56:23.000000000 \n", + ".. ... ... \n", + "288 2024-02-14 08:09:54.027999878 2024-02-14 10:30:10.001984119 \n", + "289 2024-02-14 08:46:37.000000000 2024-02-14 10:17:35.015999794 \n", + "290 2024-02-14 10:17:31.015999794 2024-02-14 12:55:24.004000186 \n", + "291 2024-02-14 10:30:06.001984119 2024-02-14 13:14:25.005983829 \n", + "292 2024-02-14 13:14:21.005983829 2024-02-14 14:20:22.001984119 \n", + "\n", + " block_duration subjects patch_info pellet_info cum_wheel_dist \n", + "0 None None None None None \n", + "1 None None None None None \n", + "2 None None None None None \n", + "3 None None None None None \n", + "4 None None None None None \n", + ".. ... ... ... ... ... \n", + "288 None None None None None \n", + "289 None None None None None \n", + "290 None None None None None \n", + "291 None None None None None \n", + "292 None None None None None \n", + "\n", + "[293 rows x 9 columns]" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "\"\"\"Create a blocks df.\"\"\"\n", "\n", @@ -296,9 +544,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:139: FutureWarning: The behavior of array concatenation with empty entries is deprecated. In a future version, this will no longer exclude empty items when determining the result dtype. To retain the old behavior, exclude the empty entries before the concat operation.\n", + " data = pd.concat([reader.read(file) for _, file in files])\n" + ] + } + ], "source": [ "\"\"\"Get subject env visits.\"\"\"\n", "\n", @@ -470,13 +727,37 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\1873280700.py:114: FutureWarning: The behavior of DataFrame.idxmin with all-NA values, or any-NA and skipna=False, is deprecated. In a future version this will raise ValueError\n", + " closest_subjects = dist_to_patch_wheel_ts_id_df.idxmin(axis=1)\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\1873280700.py:122: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\1873280700.py:114: FutureWarning: The behavior of DataFrame.idxmin with all-NA values, or any-NA and skipna=False, is deprecated. In a future version this will raise ValueError\n", + " closest_subjects = dist_to_patch_wheel_ts_id_df.idxmin(axis=1)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\1873280700.py:114: FutureWarning: The behavior of DataFrame.idxmin with all-NA values, or any-NA and skipna=False, is deprecated. In a future version this will raise ValueError\n", + " closest_subjects = dist_to_patch_wheel_ts_id_df.idxmin(axis=1)\n" + ] + } + ], "source": [ "\"\"\"Test individual block.\"\"\"\n", "\n", - "block = list(blocks_df.itertuples())[272]\n", + "block_idx = 272\n", + "block = list(blocks_df.itertuples())[block_idx]\n", "\n", "# Compute block duration\n", "blocks_df.at[block.Index, \"block_duration\"] = block.end - block.start\n", @@ -603,7 +884,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -661,6 +942,136 @@ "metadata": {}, "output_type": "display_data" }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
timepatchthresholdid
02024-02-13 15:22:02.301983833Patch1388.938394BAA-1104047
12024-02-13 15:22:49.179999828Patch1145.604313BAA-1104045
22024-02-13 15:23:06.756000042Patch1220.218814BAA-1104045
32024-02-13 15:23:25.301983833Patch1230.283633BAA-1104045
42024-02-13 15:23:45.619999886Patch1294.815140BAA-1104045
...............
1132024-02-13 17:58:58.609983921Patch2202.867291BAA-1104047
1142024-02-13 17:59:54.309984207Patch290.533233BAA-1104047
1152024-02-13 18:00:04.921984196Patch2182.347004BAA-1104047
1162024-02-13 18:00:30.177984238Patch2204.818252BAA-1104047
1172024-02-13 18:00:46.000000000Patch2151.236856BAA-1104047
\n", + "

118 rows × 4 columns

\n", + "
" + ], + "text/plain": [ + " time patch threshold id\n", + "0 2024-02-13 15:22:02.301983833 Patch1 388.938394 BAA-1104047\n", + "1 2024-02-13 15:22:49.179999828 Patch1 145.604313 BAA-1104045\n", + "2 2024-02-13 15:23:06.756000042 Patch1 220.218814 BAA-1104045\n", + "3 2024-02-13 15:23:25.301983833 Patch1 230.283633 BAA-1104045\n", + "4 2024-02-13 15:23:45.619999886 Patch1 294.815140 BAA-1104045\n", + ".. ... ... ... ...\n", + "113 2024-02-13 17:58:58.609983921 Patch2 202.867291 BAA-1104047\n", + "114 2024-02-13 17:59:54.309984207 Patch2 90.533233 BAA-1104047\n", + "115 2024-02-13 18:00:04.921984196 Patch2 182.347004 BAA-1104047\n", + "116 2024-02-13 18:00:30.177984238 Patch2 204.818252 BAA-1104047\n", + "117 2024-02-13 18:00:46.000000000 Patch2 151.236856 BAA-1104047\n", + "\n", + "[118 rows x 4 columns]" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, { "name": "stdout", "output_type": "stream", @@ -1020,11 +1431,19 @@ } ], "source": [ + "block = list(blocks_df.itertuples())[block_idx]\n", + "\n", "display(block.patch_info)\n", "\n", + "\n", + "display(block.pellet_info)\n", + "\n", + "\n", "for patch in patches:\n", + "\n", " print(f\"Subject cum wheel dist for {patch=}\")\n", - " display(block.cum_wheel_dist[patch])\n" + "\n", + " display(block.cum_wheel_dist[patch])" ] }, { From 41a4cd76232329669061f19e9d8e94caf3ce4bea Mon Sep 17 00:00:00 2001 From: Jai Date: Thu, 15 Feb 2024 16:42:22 +0000 Subject: [PATCH 13/14] block aggregation --- docs/examples/social02_block_analysis.ipynb | 1340 ++++++++++++++++--- 1 file changed, 1167 insertions(+), 173 deletions(-) diff --git a/docs/examples/social02_block_analysis.ipynb b/docs/examples/social02_block_analysis.ipynb index 1039bb4d..857c2b64 100644 --- a/docs/examples/social02_block_analysis.ipynb +++ b/docs/examples/social02_block_analysis.ipynb @@ -2,9 +2,18 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 9, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The autoreload extension is already loaded. To reload it, use:\n", + " %reload_ext autoreload\n" + ] + } + ], "source": [ "%load_ext autoreload\n", "%autoreload 2\n", @@ -12,6 +21,7 @@ "\n", "from importlib import reload\n", "from pathlib import Path\n", + "import time\n", "\n", "from dotmap import DotMap\n", "import numpy as np\n", @@ -19,6 +29,7 @@ "import plotly.express as px\n", "import plotly.graph_objs as go\n", "import seaborn as sns\n", + "from tqdm import tqdm\n", "\n", "import aeon\n", "from aeon.analysis.utils import visits, distancetravelled\n", @@ -208,17 +219,17 @@ "name": "stderr", "output_type": "stream", "text": [ - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\3226657415.py:41: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\3226657415.py:41: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", " if block_info.pellet_ct[i - 1] > 0:\n", - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\3226657415.py:43: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\3226657415.py:43: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", " elif block_info.pellet_ct[i - 1] == 0 and block_info.index[i] - block_info.index[i - 1] > pd.Timedelta(\"1s\"):\n", "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:139: FutureWarning: The behavior of array concatenation with empty entries is deprecated. In a future version, this will no longer exclude empty items when determining the result dtype. To retain the old behavior, exclude the empty entries before the concat operation.\n", " data = pd.concat([reader.read(file) for _, file in files])\n", "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:139: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", " data = pd.concat([reader.read(file) for _, file in files])\n", - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\3226657415.py:41: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\3226657415.py:41: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", " if block_info.pellet_ct[i - 1] > 0:\n", - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\3226657415.py:43: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\3226657415.py:43: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", " elif block_info.pellet_ct[i - 1] == 0 and block_info.index[i] - block_info.index[i - 1] > pd.Timedelta(\"1s\"):\n" ] }, @@ -328,11 +339,11 @@ " ...\n", " \n", " \n", - " 288\n", + " 300\n", " Z:\\aeon\\data\\raw\\AEON4\\social0.2\n", " Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...\n", - " 2024-02-14 08:09:54.027999878\n", - " 2024-02-14 10:30:10.001984119\n", + " 2024-02-15 04:14:04.005983829\n", + " 2024-02-15 05:57:04.017983913\n", " None\n", " None\n", " None\n", @@ -340,11 +351,11 @@ " None\n", " \n", " \n", - " 289\n", - " Z:\\aeon\\data\\raw\\AEON3\\social0.2\n", - " Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...\n", - " 2024-02-14 08:46:37.000000000\n", - " 2024-02-14 10:17:35.015999794\n", + " 301\n", + " Z:\\aeon\\data\\raw\\AEON4\\social0.2\n", + " Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...\n", + " 2024-02-15 05:57:00.017983913\n", + " 2024-02-15 07:10:00.077983856\n", " None\n", " None\n", " None\n", @@ -352,11 +363,11 @@ " None\n", " \n", " \n", - " 290\n", - " Z:\\aeon\\data\\raw\\AEON3\\social0.2\n", - " Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024...\n", - " 2024-02-14 10:17:31.015999794\n", - " 2024-02-14 12:55:24.004000186\n", + " 302\n", + " Z:\\aeon\\data\\raw\\AEON4\\social0.2\n", + " Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...\n", + " 2024-02-15 07:09:56.077983856\n", + " 2024-02-15 09:06:53.001984119\n", " None\n", " None\n", " None\n", @@ -364,11 +375,11 @@ " None\n", " \n", " \n", - " 291\n", + " 303\n", " Z:\\aeon\\data\\raw\\AEON4\\social0.2\n", " Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...\n", - " 2024-02-14 10:30:06.001984119\n", - " 2024-02-14 13:14:25.005983829\n", + " 2024-02-15 09:06:49.001984119\n", + " 2024-02-15 10:18:32.001984119\n", " None\n", " None\n", " None\n", @@ -376,11 +387,11 @@ " None\n", " \n", " \n", - " 292\n", + " 304\n", " Z:\\aeon\\data\\raw\\AEON4\\social0.2\n", " Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024...\n", - " 2024-02-14 13:14:21.005983829\n", - " 2024-02-14 14:20:22.001984119\n", + " 2024-02-15 10:18:28.001984119\n", + " 2024-02-15 11:35:16.000000000\n", " None\n", " None\n", " None\n", @@ -389,7 +400,7 @@ " \n", " \n", "\n", - "

293 rows × 9 columns

\n", + "

305 rows × 9 columns

\n", "" ], "text/plain": [ @@ -400,11 +411,11 @@ "3 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", "4 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", ".. ... \n", - "288 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", - "289 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", - "290 Z:\\aeon\\data\\raw\\AEON3\\social0.2 \n", - "291 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", - "292 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", + "300 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", + "301 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", + "302 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", + "303 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", + "304 Z:\\aeon\\data\\raw\\AEON4\\social0.2 \n", "\n", " sleap_model_dir \\\n", "0 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", @@ -413,11 +424,11 @@ "3 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", "4 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", ".. ... \n", - "288 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", - "289 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", - "290 Z:\\aeon\\data\\processed\\test-node1\\4310907\\2024... \n", - "291 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", - "292 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", + "300 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", + "301 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", + "302 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", + "303 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", + "304 Z:\\aeon\\data\\processed\\test-node1\\4350621\\2024... \n", "\n", " start end \\\n", "0 2024-01-31 12:59:06.005983829 2024-01-31 14:58:11.045983791 \n", @@ -426,11 +437,11 @@ "3 2024-01-31 14:58:07.045983791 2024-01-31 17:49:26.000000000 \n", "4 2024-01-31 16:18:07.001984119 2024-01-31 17:56:23.000000000 \n", ".. ... ... \n", - "288 2024-02-14 08:09:54.027999878 2024-02-14 10:30:10.001984119 \n", - "289 2024-02-14 08:46:37.000000000 2024-02-14 10:17:35.015999794 \n", - "290 2024-02-14 10:17:31.015999794 2024-02-14 12:55:24.004000186 \n", - "291 2024-02-14 10:30:06.001984119 2024-02-14 13:14:25.005983829 \n", - "292 2024-02-14 13:14:21.005983829 2024-02-14 14:20:22.001984119 \n", + "300 2024-02-15 04:14:04.005983829 2024-02-15 05:57:04.017983913 \n", + "301 2024-02-15 05:57:00.017983913 2024-02-15 07:10:00.077983856 \n", + "302 2024-02-15 07:09:56.077983856 2024-02-15 09:06:53.001984119 \n", + "303 2024-02-15 09:06:49.001984119 2024-02-15 10:18:32.001984119 \n", + "304 2024-02-15 10:18:28.001984119 2024-02-15 11:35:16.000000000 \n", "\n", " block_duration subjects patch_info pellet_info cum_wheel_dist \n", "0 None None None None None \n", @@ -439,13 +450,13 @@ "3 None None None None None \n", "4 None None None None None \n", ".. ... ... ... ... ... \n", - "288 None None None None None \n", - "289 None None None None None \n", - "290 None None None None None \n", - "291 None None None None None \n", - "292 None None None None None \n", + "300 None None None None None \n", + "301 None None None None None \n", + "302 None None None None None \n", + "303 None None None None None \n", + "304 None None None None None \n", "\n", - "[293 rows x 9 columns]" + "[305 rows x 9 columns]" ] }, "metadata": {}, @@ -548,53 +559,999 @@ "metadata": {}, "outputs": [ { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:139: FutureWarning: The behavior of array concatenation with empty entries is deprecated. In a future version, this will no longer exclude empty items when determining the result dtype. To retain the old behavior, exclude the empty entries before the concat operation.\n", - " data = pd.concat([reader.read(file) for _, file in files])\n" + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\api.py:139: FutureWarning: The behavior of array concatenation with empty entries is deprecated. In a future version, this will no longer exclude empty items when determining the result dtype. To retain the old behavior, exclude the empty entries before the concat operation.\n", + " data = pd.concat([reader.read(file) for _, file in files])\n" + ] + } + ], + "source": [ + "\"\"\"Get subject env visits.\"\"\"\n", + "\n", + "subject_env_visits = {}\n", + "\n", + "for root, arena in zip(roots, arenas):\n", + " subject_visits = aeon.load(root, social02.Environment.SubjectVisits, exp_start, exp_end)\n", + " # Find all rows where:\n", + " # - 'id' column starts with \"*AA\"\n", + " # - 'type' column is either \"Enter\" or \"Exit\" or \"Remain\",\n", + " # - 'region' column is \"Environment\"\n", + " subject_visits = subject_visits[\n", + " (subject_visits.id.str.contains(\"^.*AA\"))\n", + " & (subject_visits.type.isin([\"Enter\", \"Exit\", \"Remain\"]))\n", + " & (subject_visits.region == \"Environment\")\n", + " ]\n", + " subject_env_visits[arena] = subject_visits" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "subject_env_visits" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Block Iteration:: 0it [00:00, ?it/s]" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 1it [01:04, 64.85s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 2it [01:37, 46.20s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 3it [02:09, 39.57s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 4it [03:17, 50.59s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 5it [03:51, 44.59s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 18it [07:26, 13.00s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 22it [08:48, 16.72s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 23it [09:18, 20.98s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 24it [10:21, 33.41s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 25it [10:53, 33.17s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 26it [11:58, 42.53s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 27it [12:28, 38.88s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 28it [13:32, 46.50s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 29it [14:17, 45.90s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 30it [15:19, 50.72s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 31it [15:52, 45.54s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 32it [16:57, 51.17s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 36it [18:17, 26.19s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 41it [19:51, 18.73s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 45it [21:38, 20.51s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 47it [22:31, 22.84s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 49it [23:36, 26.52s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 50it [24:25, 33.51s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 51it [25:33, 43.68s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 52it [26:38, 50.27s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 53it [27:14, 46.00s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 54it [28:20, 51.97s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 55it [28:58, 47.64s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 56it [29:34, 44.25s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 57it [30:40, 50.66s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 58it [31:14, 45.66s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 59it [32:16, 50.58s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 60it [32:48, 45.04s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 63it [34:21, 32.37s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 64it [34:54, 32.39s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 65it [35:58, 42.10s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 66it [36:34, 40.24s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 67it [37:43, 48.66s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 71it [39:00, 23.97s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 72it [40:02, 35.53s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 73it [41:04, 43.37s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 74it [41:39, 40.86s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 75it [42:59, 52.51s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 76it [43:51, 52.48s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 77it [45:22, 64.08s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 78it [46:02, 56.74s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 79it [46:34, 49.40s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 80it [47:40, 54.49s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 86it [49:32, 19.97s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 87it [50:39, 34.15s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 88it [51:44, 43.38s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 89it [52:20, 41.20s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 91it [53:42, 37.99s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 92it [54:48, 46.48s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 99it [57:20, 19.46s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 100it [58:00, 25.47s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 101it [59:07, 38.04s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 102it [1:00:29, 51.11s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 103it [1:01:12, 48.77s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 104it [1:01:56, 47.31s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 105it [1:03:21, 58.54s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 106it [1:04:21, 59.12s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 107it [1:05:50, 67.99s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 108it [1:06:38, 62.04s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 109it [1:08:16, 72.95s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 110it [1:09:09, 66.80s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 111it [1:10:37, 73.26s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 114it [1:12:16, 45.56s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 121it [1:15:21, 23.00s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 122it [1:16:50, 42.75s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 124it [1:18:25, 41.91s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 125it [1:19:16, 44.78s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 126it [1:20:49, 59.20s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 127it [1:21:41, 56.97s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 128it [1:23:04, 64.76s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 129it [1:24:27, 70.31s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 130it [1:25:15, 63.71s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 131it [1:26:01, 58.33s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 133it [1:27:49, 53.07s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 134it [1:28:31, 49.95s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 135it [1:29:51, 58.73s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 136it [1:30:33, 53.70s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 146it [1:34:24, 19.64s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 147it [1:35:08, 27.03s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 148it [1:36:45, 48.01s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 149it [1:37:26, 45.83s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 150it [1:39:00, 60.27s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 151it [1:39:41, 54.72s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 152it [1:40:23, 50.85s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104048' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 153it [1:41:45, 60.04s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\625617972.py:123: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 158it [1:43:19, 22.14s/it]C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\io\\reader.py:383: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'BAA-1104045' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.\n", + " data.loc[data[\"class\"] == i, \"class\"] = subj\n", + "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + " distance = distance - distance[0]\n", + "Block Iteration:: 158it [1:43:40, 39.37s/it]\n" + ] + }, + { + "ename": "ValueError", + "evalue": "attempt to get argmin of an empty sequence", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[20], line 111\u001b[0m\n\u001b[0;32m 108\u001b[0m dist_to_patch_pel_ts_id_df[subject] \u001b[38;5;241m=\u001b[39m dist_to_patch_pel_ts_subj[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdist_to_patch\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m 109\u001b[0m \u001b[38;5;66;03m# /ssss>\u001b[39;00m\n\u001b[0;32m 110\u001b[0m \u001b[38;5;66;03m# 111\u001b[0m patch_df_for_pellets_df[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mid\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[43mdist_to_patch_pel_ts_id_df\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43midxmin\u001b[49m\u001b[43m(\u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\u001b[38;5;241m.\u001b[39mvalues\n\u001b[0;32m 112\u001b[0m \u001b[38;5;66;03m# /ssss>\u001b[39;00m\n\u001b[0;32m 113\u001b[0m \u001b[38;5;66;03m# 11498\u001b[0m res \u001b[38;5;241m=\u001b[39m \u001b[43mdata\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_reduce\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 11499\u001b[0m \u001b[43m \u001b[49m\u001b[43mnanops\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mnanargmin\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43margmin\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mskipna\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mskipna\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mnumeric_only\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\n\u001b[0;32m 11500\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 11501\u001b[0m indices \u001b[38;5;241m=\u001b[39m res\u001b[38;5;241m.\u001b[39m_values\n\u001b[0;32m 11502\u001b[0m \u001b[38;5;66;03m# indices will always be np.ndarray since axis is not N\u001b[39;00m\n", + "File \u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\site-packages\\pandas\\core\\frame.py:11207\u001b[0m, in \u001b[0;36mDataFrame._reduce\u001b[1;34m(self, op, name, axis, skipna, numeric_only, filter_type, **kwds)\u001b[0m\n\u001b[0;32m 11203\u001b[0m df \u001b[38;5;241m=\u001b[39m df\u001b[38;5;241m.\u001b[39mT\n\u001b[0;32m 11205\u001b[0m \u001b[38;5;66;03m# After possibly _get_data and transposing, we are now in the\u001b[39;00m\n\u001b[0;32m 11206\u001b[0m \u001b[38;5;66;03m# simple case where we can use BlockManager.reduce\u001b[39;00m\n\u001b[1;32m> 11207\u001b[0m res \u001b[38;5;241m=\u001b[39m \u001b[43mdf\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_mgr\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreduce\u001b[49m\u001b[43m(\u001b[49m\u001b[43mblk_func\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 11208\u001b[0m out \u001b[38;5;241m=\u001b[39m df\u001b[38;5;241m.\u001b[39m_constructor_from_mgr(res, axes\u001b[38;5;241m=\u001b[39mres\u001b[38;5;241m.\u001b[39maxes)\u001b[38;5;241m.\u001b[39miloc[\u001b[38;5;241m0\u001b[39m]\n\u001b[0;32m 11209\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m out_dtype \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m out\u001b[38;5;241m.\u001b[39mdtype \u001b[38;5;241m!=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mboolean\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n", + "File \u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\site-packages\\pandas\\core\\internals\\managers.py:1459\u001b[0m, in \u001b[0;36mBlockManager.reduce\u001b[1;34m(self, func)\u001b[0m\n\u001b[0;32m 1457\u001b[0m res_blocks: \u001b[38;5;28mlist\u001b[39m[Block] \u001b[38;5;241m=\u001b[39m []\n\u001b[0;32m 1458\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m blk \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mblocks:\n\u001b[1;32m-> 1459\u001b[0m nbs \u001b[38;5;241m=\u001b[39m \u001b[43mblk\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreduce\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfunc\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 1460\u001b[0m res_blocks\u001b[38;5;241m.\u001b[39mextend(nbs)\n\u001b[0;32m 1462\u001b[0m index \u001b[38;5;241m=\u001b[39m Index([\u001b[38;5;28;01mNone\u001b[39;00m]) \u001b[38;5;66;03m# placeholder\u001b[39;00m\n", + "File \u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\site-packages\\pandas\\core\\internals\\blocks.py:377\u001b[0m, in \u001b[0;36mBlock.reduce\u001b[1;34m(self, func)\u001b[0m\n\u001b[0;32m 371\u001b[0m \u001b[38;5;129m@final\u001b[39m\n\u001b[0;32m 372\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mreduce\u001b[39m(\u001b[38;5;28mself\u001b[39m, func) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28mlist\u001b[39m[Block]:\n\u001b[0;32m 373\u001b[0m \u001b[38;5;66;03m# We will apply the function and reshape the result into a single-row\u001b[39;00m\n\u001b[0;32m 374\u001b[0m \u001b[38;5;66;03m# Block with the same mgr_locs; squeezing will be done at a higher level\u001b[39;00m\n\u001b[0;32m 375\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mndim \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m2\u001b[39m\n\u001b[1;32m--> 377\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mvalues\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 379\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mvalues\u001b[38;5;241m.\u001b[39mndim \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[0;32m 380\u001b[0m res_values \u001b[38;5;241m=\u001b[39m result\n", + "File \u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\site-packages\\pandas\\core\\frame.py:11139\u001b[0m, in \u001b[0;36mDataFrame._reduce..blk_func\u001b[1;34m(values, axis)\u001b[0m\n\u001b[0;32m 11137\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m np\u001b[38;5;241m.\u001b[39marray([result])\n\u001b[0;32m 11138\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m> 11139\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mop\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvalues\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mskipna\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mskipna\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwds\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[1;32mc:\\Users\\jai\\mambaforge\\envs\\aeon\\Lib\\site-packages\\pandas\\core\\nanops.py:1188\u001b[0m, in \u001b[0;36mnanargmin\u001b[1;34m(values, axis, skipna, mask)\u001b[0m\n\u001b[0;32m 1186\u001b[0m values, mask \u001b[38;5;241m=\u001b[39m _get_values(values, \u001b[38;5;28;01mTrue\u001b[39;00m, fill_value_typ\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m+inf\u001b[39m\u001b[38;5;124m\"\u001b[39m, mask\u001b[38;5;241m=\u001b[39mmask)\n\u001b[0;32m 1187\u001b[0m \u001b[38;5;66;03m# error: Need type annotation for 'result'\u001b[39;00m\n\u001b[1;32m-> 1188\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mvalues\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43margmin\u001b[49m\u001b[43m(\u001b[49m\u001b[43maxis\u001b[49m\u001b[43m)\u001b[49m \u001b[38;5;66;03m# type: ignore[var-annotated]\u001b[39;00m\n\u001b[0;32m 1189\u001b[0m result \u001b[38;5;241m=\u001b[39m _maybe_arg_null_out(result, axis, mask, skipna)\n\u001b[0;32m 1190\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n", + "\u001b[1;31mValueError\u001b[0m: attempt to get argmin of an empty sequence" ] } ], - "source": [ - "\"\"\"Get subject env visits.\"\"\"\n", - "\n", - "subject_env_visits = {}\n", - "\n", - "for root, arena in zip(roots, arenas):\n", - " subject_visits = aeon.load(root, social02.Environment.SubjectVisits, exp_start, exp_end)\n", - " # Find all rows where:\n", - " # - 'id' column starts with \"*AA\"\n", - " # - 'type' column is either \"Enter\" or \"Exit\" or \"Remain\",\n", - " # - 'region' column is \"Environment\"\n", - " subject_visits = subject_visits[\n", - " (subject_visits.id.str.contains(\"^.*AA\"))\n", - " & (subject_visits.type.isin([\"Enter\", \"Exit\", \"Remain\"]))\n", - " & (subject_visits.region == \"Environment\")\n", - " ]\n", - " subject_env_visits[arena] = subject_visits" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "subject_env_visits" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], "source": [ "\"\"\"Fill out blocks df.\"\"\"\n", "\n", "skipped_blocks = np.full(len(blocks_df), False)\n", "\n", - "for i, block in enumerate(blocks_df.itertuples()):\n", + "for i, block in tqdm(enumerate(blocks_df.itertuples()), desc=\"Block Iteration:\"):\n", " # Compute block duration\n", " blocks_df.at[block.Index, \"block_duration\"] = block.end - block.start\n", " # pd.Timedelta(\"1s\"))\n", - " # if cum_pel_ct < good_block_pel_ct:\n", - " # continue\n", + " if (cum_pel_ct < good_block_pel_ct) or (len(subjects) < 1):\n", + " skipped_blocks[i] = True\n", + " continue\n", " # /s>\n", " # pd.Timedelta(\"1s\"), (True,)))\n", " patch_df_for_pellets_df = patch_df[patch_df_good_indxs].reset_index()[[\"time\", \"threshold\"]]\n", " patch_df_for_pellets_df[\"patch\"] = patch\n", @@ -718,13 +1676,6 @@ " blocks_df.at[block.Index, \"cum_wheel_dist\"] = cum_wheel_dist_dm" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "code", "execution_count": 5, @@ -738,17 +1689,17 @@ " data.loc[data[\"class\"] == i, \"class\"] = subj\n", "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", " distance = distance - distance[0]\n", - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\1873280700.py:114: FutureWarning: The behavior of DataFrame.idxmin with all-NA values, or any-NA and skipna=False, is deprecated. In a future version this will raise ValueError\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\4086213747.py:114: FutureWarning: The behavior of DataFrame.idxmin with all-NA values, or any-NA and skipna=False, is deprecated. In a future version this will raise ValueError\n", " closest_subjects = dist_to_patch_wheel_ts_id_df.idxmin(axis=1)\n", - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\1873280700.py:122: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\4086213747.py:122: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", " pellets_stats_df = pd.concat([pellets_stats_df, patch_df_for_pellets_df], ignore_index=True)\n", "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", " distance = distance - distance[0]\n", - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\1873280700.py:114: FutureWarning: The behavior of DataFrame.idxmin with all-NA values, or any-NA and skipna=False, is deprecated. In a future version this will raise ValueError\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\4086213747.py:114: FutureWarning: The behavior of DataFrame.idxmin with all-NA values, or any-NA and skipna=False, is deprecated. In a future version this will raise ValueError\n", " closest_subjects = dist_to_patch_wheel_ts_id_df.idxmin(axis=1)\n", "C:\\Users\\jai\\ProjectAeon\\aeon_mecha\\aeon\\analysis\\utils.py:20: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", " distance = distance - distance[0]\n", - "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_53696\\1873280700.py:114: FutureWarning: The behavior of DataFrame.idxmin with all-NA values, or any-NA and skipna=False, is deprecated. In a future version this will raise ValueError\n", + "C:\\Users\\jai\\AppData\\Local\\Temp\\ipykernel_60492\\4086213747.py:114: FutureWarning: The behavior of DataFrame.idxmin with all-NA values, or any-NA and skipna=False, is deprecated. In a future version this will raise ValueError\n", " closest_subjects = dist_to_patch_wheel_ts_id_df.idxmin(axis=1)\n" ] } @@ -806,14 +1757,14 @@ "for i, patch in enumerate(patches):\n", " # \n", " # pd.Timedelta(\"1s\"), (True,)))\n", " patch_df_for_pellets_df = patch_df[patch_df_good_indxs].reset_index()[[\"time\", \"threshold\"]]\n", " patch_df_for_pellets_df[\"patch\"] = patch\n", @@ -828,7 +1779,7 @@ " patch_df_for_pellets_df[\"id\"] = subjects[0]\n", " else:\n", " # \n", - " # \n", - " # \n", " \n", " Patch1\n", - " 303.030303\n", + " 300.0\n", " 75.0\n", " \n", " \n", @@ -933,10 +1884,10 @@ "" ], "text/plain": [ - " mean offset\n", - "Patch1 303.030303 75.0\n", - "Patch2 100.0 75.0\n", - "Patch3 500.0 75.0" + " mean offset\n", + "Patch1 300.0 75.0\n", + "Patch2 100.0 75.0\n", + "Patch3 500.0 75.0" ] }, "metadata": {}, @@ -1142,28 +2093,28 @@ " \n", " \n", " 2024-02-13 18:03:14.501984118\n", - " 1878.110552\n", - " 531.869738\n", + " 1878.110554\n", + " 531.869735\n", " \n", " \n", " 2024-02-13 18:03:14.601984024\n", - " 1878.104416\n", - " 531.869738\n", + " 1878.104418\n", + " 531.869735\n", " \n", " \n", " 2024-02-13 18:03:14.701983929\n", - " 1878.110552\n", - " 531.869738\n", + " 1878.110554\n", + " 531.869735\n", " \n", " \n", " 2024-02-13 18:03:14.801983833\n", - " 1878.102882\n", - " 531.869738\n", + " 1878.102884\n", + " 531.869735\n", " \n", " \n", " 2024-02-13 18:03:14.901984215\n", - " 1878.109018\n", - " 531.869738\n", + " 1878.109020\n", + " 531.869735\n", " \n", " \n", "\n", @@ -1179,11 +2130,11 @@ "2024-02-13 15:17:16.301983833 0.000000 0.000000\n", "2024-02-13 15:17:16.401984215 -0.003068 0.000000\n", "... ... ...\n", - "2024-02-13 18:03:14.501984118 1878.110552 531.869738\n", - "2024-02-13 18:03:14.601984024 1878.104416 531.869738\n", - "2024-02-13 18:03:14.701983929 1878.110552 531.869738\n", - "2024-02-13 18:03:14.801983833 1878.102882 531.869738\n", - "2024-02-13 18:03:14.901984215 1878.109018 531.869738\n", + "2024-02-13 18:03:14.501984118 1878.110554 531.869735\n", + "2024-02-13 18:03:14.601984024 1878.104418 531.869735\n", + "2024-02-13 18:03:14.701983929 1878.110554 531.869735\n", + "2024-02-13 18:03:14.801983833 1878.102884 531.869735\n", + "2024-02-13 18:03:14.901984215 1878.109020 531.869735\n", "\n", "[99590 rows x 2 columns]" ] @@ -1261,28 +2212,28 @@ " \n", " \n", " 2024-02-13 18:03:14.501984118\n", - " 6166.591049\n", - " 12448.501540\n", + " 6166.591093\n", + " 12448.501498\n", " \n", " \n", " 2024-02-13 18:03:14.601984024\n", - " 6166.591049\n", - " 12448.498472\n", + " 6166.591093\n", + " 12448.498430\n", " \n", " \n", " 2024-02-13 18:03:14.701983929\n", - " 6166.591049\n", - " 12448.500006\n", + " 6166.591093\n", + " 12448.499964\n", " \n", " \n", " 2024-02-13 18:03:14.801983833\n", - " 6166.591049\n", - " 12448.498472\n", + " 6166.591093\n", + " 12448.498430\n", " \n", " \n", " 2024-02-13 18:03:14.901984215\n", - " 6166.594117\n", - " 12448.498472\n", + " 6166.594161\n", + " 12448.498430\n", " \n", " \n", "\n", @@ -1298,11 +2249,11 @@ "2024-02-13 15:17:16.301983833 0.000000 -0.007670\n", "2024-02-13 15:17:16.401984215 0.000000 -0.006136\n", "... ... ...\n", - "2024-02-13 18:03:14.501984118 6166.591049 12448.501540\n", - "2024-02-13 18:03:14.601984024 6166.591049 12448.498472\n", - "2024-02-13 18:03:14.701983929 6166.591049 12448.500006\n", - "2024-02-13 18:03:14.801983833 6166.591049 12448.498472\n", - "2024-02-13 18:03:14.901984215 6166.594117 12448.498472\n", + "2024-02-13 18:03:14.501984118 6166.591093 12448.501498\n", + "2024-02-13 18:03:14.601984024 6166.591093 12448.498430\n", + "2024-02-13 18:03:14.701983929 6166.591093 12448.499964\n", + "2024-02-13 18:03:14.801983833 6166.591093 12448.498430\n", + "2024-02-13 18:03:14.901984215 6166.594161 12448.498430\n", "\n", "[99590 rows x 2 columns]" ] @@ -1356,22 +2307,22 @@ " \n", " 2024-02-13 15:17:16.101984024\n", " 0.000000\n", - " 0.003068\n", + " 0.003069\n", " \n", " \n", " 2024-02-13 15:17:16.201983929\n", " 0.000000\n", - " 0.006136\n", + " 0.006137\n", " \n", " \n", " 2024-02-13 15:17:16.301983833\n", " 0.000000\n", - " 0.003068\n", + " 0.003069\n", " \n", " \n", " 2024-02-13 15:17:16.401984215\n", " 0.000000\n", - " 0.003068\n", + " 0.003069\n", " \n", " \n", " ...\n", @@ -1380,28 +2331,28 @@ " \n", " \n", " 2024-02-13 18:03:14.501984118\n", - " 408.296975\n", - " 369.892956\n", + " 408.296965\n", + " 369.892968\n", " \n", " \n", " 2024-02-13 18:03:14.601984024\n", - " 408.295441\n", - " 369.892956\n", + " 408.295431\n", + " 369.892968\n", " \n", " \n", " 2024-02-13 18:03:14.701983929\n", - " 408.300043\n", - " 369.892956\n", + " 408.300033\n", + " 369.892968\n", " \n", " \n", " 2024-02-13 18:03:14.801983833\n", - " 408.296975\n", - " 369.892956\n", + " 408.296965\n", + " 369.892968\n", " \n", " \n", " 2024-02-13 18:03:14.901984215\n", - " 408.298509\n", - " 369.892956\n", + " 408.298499\n", + " 369.892968\n", " \n", " \n", "\n", @@ -1412,16 +2363,16 @@ " BAA-1104045 BAA-1104047\n", "time \n", "2024-02-13 15:17:16.001984119 0.000000 -0.000000\n", - "2024-02-13 15:17:16.101984024 0.000000 0.003068\n", - "2024-02-13 15:17:16.201983929 0.000000 0.006136\n", - "2024-02-13 15:17:16.301983833 0.000000 0.003068\n", - "2024-02-13 15:17:16.401984215 0.000000 0.003068\n", + "2024-02-13 15:17:16.101984024 0.000000 0.003069\n", + "2024-02-13 15:17:16.201983929 0.000000 0.006137\n", + "2024-02-13 15:17:16.301983833 0.000000 0.003069\n", + "2024-02-13 15:17:16.401984215 0.000000 0.003069\n", "... ... ...\n", - "2024-02-13 18:03:14.501984118 408.296975 369.892956\n", - "2024-02-13 18:03:14.601984024 408.295441 369.892956\n", - "2024-02-13 18:03:14.701983929 408.300043 369.892956\n", - "2024-02-13 18:03:14.801983833 408.296975 369.892956\n", - "2024-02-13 18:03:14.901984215 408.298509 369.892956\n", + "2024-02-13 18:03:14.501984118 408.296965 369.892968\n", + "2024-02-13 18:03:14.601984024 408.295431 369.892968\n", + "2024-02-13 18:03:14.701983929 408.300033 369.892968\n", + "2024-02-13 18:03:14.801983833 408.296965 369.892968\n", + "2024-02-13 18:03:14.901984215 408.298499 369.892968\n", "\n", "[99590 rows x 2 columns]" ] @@ -1435,14 +2386,10 @@ "\n", "display(block.patch_info)\n", "\n", - "\n", "display(block.pellet_info)\n", "\n", - "\n", "for patch in patches:\n", - "\n", " print(f\"Subject cum wheel dist for {patch=}\")\n", - "\n", " display(block.cum_wheel_dist[patch])" ] }, @@ -1480,7 +2427,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Plots" + "## Block Plots" ] }, { @@ -1488,7 +2435,9 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "# x,y animal location, over time, per subject" + ] }, { "cell_type": "code", @@ -1505,7 +2454,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Cumulative pellet count over time, per patch, per subject (0, 0)" + "# Cumulative pellet count over time, per patch, per subject" ] }, { @@ -1514,7 +2463,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Running cumulative patch preference, per subject: each patch as a line (0, 1)" + "# Pellet threshold vals over time, per patch, per subject (1, 0)" ] }, { @@ -1523,7 +2472,16 @@ "metadata": {}, "outputs": [], "source": [ - "# Pellet threshold vals over time, per patch, per subject (1, 0)" + "# Cumulative wheel distance over time, per patch, per subject" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Running cumulative patch preference, per subject: each patch as a line (0, 1)" ] }, { @@ -1544,6 +2502,35 @@ "# Pairwise Null distribution 2.5th and 97.5th percentiles with per-patch preference vals, per subject (1, 1)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Overall Plots" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Weight over time" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Cumulative patch preference per subject over time per block per patch (by patch number, and patch rate).\n", + "\n", + "# By last 25% of block.\n", + "\n", + "# Analyze (E, E, E; H, H, H) blocks separately" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1558,6 +2545,13 @@ "## Research Questions" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "markdown", "metadata": {}, From b27f119b8805bd1e9363cccfd729b4da7138d997 Mon Sep 17 00:00:00 2001 From: Jai Date: Thu, 15 Feb 2024 23:11:12 +0000 Subject: [PATCH 14/14] added deps --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 458227fd..8ee77cb4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,7 @@ dependencies = [ "scikit-learn", "scipy", "seaborn", + "tqdm", "xarray>=0.12.3", ]