Fix chunk_episodes() bugs: set segment_start_timestamp as int

pull/103/head
Meng Li 2020-10-19 19:36:26 -04:00
parent 90f70255ae
commit 8c0f6a000d
2 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,5 @@
source("renv/activate.R") source("renv/activate.R")
library("tibble")
library("dplyr") library("dplyr")
library("tidyr") library("tidyr")
library("tibble") library("tibble")

View File

@ -35,7 +35,7 @@ def chunk_episodes(sensor_episodes):
sensor_episodes = sensor_episodes.copy() sensor_episodes = sensor_episodes.copy()
# Unix timestamp for current segment in milliseconds # Unix timestamp for current segment in milliseconds
sensor_episodes[["segment_start_timestamp", "segment_end_timestamp"]] = sensor_episodes["timestamps_segment"].str.split(",", expand=True) sensor_episodes[["segment_start_timestamp", "segment_end_timestamp"]] = sensor_episodes["timestamps_segment"].str.split(",", expand=True).astype(int)
# Compute chunked timestamp # Compute chunked timestamp
sensor_episodes["chunked_start_timestamp"] = sensor_episodes[["start_timestamp", "segment_start_timestamp"]].max(axis=1) sensor_episodes["chunked_start_timestamp"] = sensor_episodes[["start_timestamp", "segment_start_timestamp"]].max(axis=1)