vastorbit.VastFrame.first¶
- VastFrame.first(ts: str, offset: str) VastFrame¶
Filters the VastFrame by only keeping the first records.
- Parameters:
ts (str) – TS (Time Series) VastColumn used to filter the data. The VastColumn type must be date (date, datetime, timestamp…)
offset (str) – Interval offset. For example, to filter and keep only the first 6 months of records, offset should be set to ‘6 months’. Format: ‘1 day’, ‘6 months’, ‘2 hours’, etc.
- Returns:
self
- Return type:
Examples
import vastorbit as vo vdf = vo.VastFrame({ "time": [ "1993-11-01", "1993-11-02", "1993-11-03", "1993-11-04", "1993-11-05", ], "val": [0., 1., 2., 4., 5.], }) vdf["time"].astype("timestamp") # Keep first 1 day of records vdf.first(ts="time", offset="1 day")