Browse Source
* Add convert_pd_timestamp_to_ms function to utils * Use datapoint time in segment if it is availablepull/1/head
6 changed files with 38 additions and 33 deletions
@ -1,2 +1,3 @@ |
|||||||
from utils.common import * |
from utils.common import * |
||||||
from utils.segments import * |
from utils.segments import * |
||||||
|
from utils.time import * |
||||||
|
@ -0,0 +1,8 @@ |
|||||||
|
import pandas as pd |
||||||
|
|
||||||
|
def convert_sec_to_ms(sec) -> int: |
||||||
|
return int(sec) * 1000 |
||||||
|
|
||||||
|
def convert_pd_timestamp_to_ms(timestamp: pd.Timestamp) -> int: |
||||||
|
# TODO: convert from nanoseconds to millisecond in a better way: not by dividing by 10^6 |
||||||
|
return int(timestamp.value) / 1000000 |
Loading…
Reference in new issue