Deephaven’s modernized time library — Part 2 | Deephaven

Deephaven's modernized time library -- Part 2 | Deephaven


import datetime
import pandas as pd
import numpy as np

from deephaven import new_table
from deephaven.column import datetime_col, int_col
from deephaven.time import to_j_instant

first_time = 1694543451
second_time = "2021-07-04T08:00:00 ET"
third_time = datetime.datetime(2021, 9, 6, 12, 30)
fourth_time = pd.Timestamp(year=2021, month=12, day=25, hour=21, minute=15)
fifth_time = np.datetime64("2021-12-25T21:15:00")


t1 = new_table([
datetime_col("Timestamp", [first_time, second_time, third_time, fourth_time, fifth_time]),
int_col("Value", [1, 2, 3, 4, 5])
])


filter_time = to_j_instant( third_time + datetime.timedelta(days=90) )
t2 = t1.where("Timestamp > filter_time")



Source link
lol

By stp2y

Leave a Reply

Your email address will not be published. Required fields are marked *

No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.