vDataFrame.at_time

In [ ]:
vDataFrame.at_time(ts: (str, datetime.timedelta),
                   time: str)

Filters the vDataFrame by only keeping the records at the input time.

Parameters

Name Type Optional Description
ts
str
❌
TS (Time Series) vcolumn to use to filter the data. The vcolumn type must be date like (date, datetime, timestamp...)
time
str / time
❌
Input Time. For example, time = '12:00' will filter the data when time('ts') is equal to 12:00.

Returns

vDataFrame : self

Example

In [120]:
from verticapy.datasets import load_smart_meters
sm = load_smart_meters()
display(sm)
123
val
Numeric(11,7)
📅
time
Timestamp
123
id
Int
10.03700002014-01-01 01:15:002
20.08000002014-01-01 02:30:005
30.08100002014-01-01 03:00:001
41.48900002014-01-01 05:00:003
50.07200002014-01-01 06:00:005
62.30600002014-01-01 07:15:009
70.10200002014-01-01 07:45:004
80.09700002014-01-01 10:45:008
90.02900002014-01-01 11:00:000
100.50600002014-01-01 11:00:006
110.12900002014-01-01 11:15:005
120.62200002014-01-01 13:00:004
130.27700002014-01-01 13:45:000
140.23500002014-01-01 15:30:009
150.62300002014-01-01 16:45:007
161.35000002014-01-01 17:00:005
170.55900002014-01-01 17:15:001
180.37500002014-01-01 19:15:001
190.54000002014-01-01 22:30:009
200.35800002014-01-02 00:30:002
210.13900002014-01-02 01:30:003
220.05500002014-01-02 02:45:003
230.08600002014-01-02 03:00:006
240.04400002014-01-02 03:30:001
250.07300002014-01-02 03:45:008
260.10000002014-01-02 04:45:007
270.04400002014-01-02 05:30:001
280.04800002014-01-02 06:45:001
290.05500002014-01-02 06:45:005
300.08200002014-01-02 10:15:001
310.32100002014-01-02 10:45:000
320.30500002014-01-02 11:15:000
330.39700002014-01-02 12:30:005
340.35800002014-01-02 13:45:000
350.25400002014-01-02 14:30:004
360.11500002014-01-02 15:30:000
370.18500002014-01-02 15:30:007
380.52400002014-01-02 16:00:008
390.87100002014-01-02 17:45:004
401.03800002014-01-02 19:30:009
411.47800002014-01-02 19:45:006
421.77600002014-01-02 20:15:008
430.09400002014-01-03 00:30:008
440.31300002014-01-03 00:45:006
450.13300002014-01-03 01:45:009
460.06000002014-01-03 02:45:006
470.08500002014-01-03 03:15:009
480.06600002014-01-03 04:30:003
490.06800002014-01-03 04:30:001
500.06700002014-01-03 05:45:008
510.03200002014-01-03 06:30:007
520.08400002014-01-03 07:45:009
530.27200002014-01-03 07:45:002
540.07100002014-01-03 08:30:000
551.50600002014-01-03 09:15:004
560.07400002014-01-03 10:30:009
572.10800002014-01-03 11:00:004
580.10300002014-01-03 12:15:008
590.48900002014-01-03 19:45:007
600.67200002014-01-03 21:30:007
610.59100002014-01-03 22:15:005
621.93800002014-01-03 22:15:001
630.28400002014-01-03 23:30:004
640.13100002014-01-04 01:15:006
651.54600002014-01-04 01:30:001
660.36100002014-01-04 01:45:006
670.38300002014-01-04 02:15:006
680.18500002014-01-04 02:45:005
690.06200002014-01-04 05:45:008
700.26700002014-01-04 06:00:005
710.07700002014-01-04 06:45:008
720.06800002014-01-04 07:30:002
730.30900002014-01-04 07:45:004
740.15300002014-01-04 10:00:008
750.54500002014-01-04 10:45:007
761.26800002014-01-04 11:45:008
770.07600002014-01-04 12:00:002
781.36000002014-01-04 13:30:008
790.28500002014-01-04 17:15:002
800.44700002014-01-04 17:15:009
810.64100002014-01-04 18:00:004
820.82700002014-01-04 22:30:004
830.32300002014-01-04 23:45:000
840.30500002014-01-05 02:15:006
850.11100002014-01-05 04:00:009
860.07500002014-01-05 06:30:009
870.09000002014-01-05 08:00:004
880.16000002014-01-05 08:45:009
890.28100002014-01-05 10:00:003
900.58000002014-01-05 10:15:006
911.13200002014-01-05 11:30:006
920.62500002014-01-05 17:30:004
930.53700002014-01-05 19:45:004
940.54600002014-01-05 19:45:001
950.53900002014-01-05 23:30:009
960.08500002014-01-06 01:15:000
970.08700002014-01-06 02:45:008
980.06900002014-01-06 05:00:003
990.02700002014-01-06 07:45:003
1000.53000002014-01-06 07:45:002
Rows: 1-100 of 11844 | Columns: 3
In [121]:
sm.at_time(ts = "time", time = "12:00")
11704 element(s) was/were filtered
123
val
Numeric(11,7)
📅
time
Timestamp
123
id
Int
10.07600002014-01-04 12:00:002
20.16100002014-01-09 12:00:006
30.04900002014-01-15 12:00:009
40.02000002014-01-19 12:00:004
50.14400002014-01-21 12:00:007
60.32300002014-01-27 12:00:004
70.10400002014-02-01 12:00:007
80.18700002014-02-04 12:00:000
90.04900002014-02-11 12:00:009
100.29000002014-02-19 12:00:009
110.17400002014-02-23 12:00:000
120.12400002014-02-26 12:00:008
130.11800002014-02-28 12:00:006
140.29900002014-02-28 12:00:002
150.07800002014-03-09 12:00:003
160.06600002014-03-10 12:00:007
170.08700002014-03-12 12:00:003
180.68400002014-03-17 12:00:006
190.05400002014-03-18 12:00:000
200.02100002014-03-22 12:00:005
210.16500002014-03-24 12:00:009
220.15200002014-03-27 12:00:001
231.29800002014-03-28 12:00:002
240.03900002014-03-31 12:00:001
250.15900002014-04-02 12:00:007
265.42400002014-04-05 12:00:009
270.05400002014-04-14 12:00:004
280.13700002014-04-22 12:00:002
290.95400002014-04-22 12:00:004
300.20100002014-04-24 12:00:006
310.34600002014-04-24 12:00:008
320.06100002014-04-25 12:00:003
330.27900002014-05-06 12:00:007
340.02100002014-05-13 12:00:004
350.83100002014-05-14 12:00:001
360.12000002014-05-15 12:00:009
370.05100002014-05-26 12:00:008
385.09900002014-05-27 12:00:006
390.09700002014-06-04 12:00:001
401.01300002014-06-04 12:00:009
410.09900002014-06-08 12:00:004
420.08000002014-06-09 12:00:007
430.02000002014-06-11 12:00:000
440.31000002014-06-14 12:00:001
450.12500002014-06-23 12:00:008
460.05800002014-07-07 12:00:000
470.49800002014-07-11 12:00:007
481.54100002014-07-13 12:00:009
490.28300002014-07-16 12:00:001
500.05500002014-07-24 12:00:003
510.28900002014-08-04 12:00:002
520.10400002014-08-07 12:00:004
530.08700002014-08-09 12:00:002
540.15000002014-08-11 12:00:001
550.31800002014-08-11 12:00:006
560.09500002014-08-13 12:00:005
570.09300002014-08-22 12:00:007
580.09200002014-08-26 12:00:006
590.44500002014-08-28 12:00:006
600.07400002014-09-05 12:00:004
611.06900002014-09-06 12:00:002
620.04900002014-09-09 12:00:008
630.07500002014-09-09 12:00:005
640.04400002014-09-13 12:00:008
650.02500002014-09-14 12:00:004
660.10900002014-09-17 12:00:003
670.08000002014-09-26 12:00:007
680.16400002014-10-10 12:00:006
690.00400002014-10-16 12:00:006
700.12100002014-10-21 12:00:000
712.14000002014-10-22 12:00:009
720.24200002014-11-04 12:00:009
731.05100002014-11-04 12:00:007
740.14700002014-11-08 12:00:001
750.07000002014-11-19 12:00:009
760.11900002014-11-22 12:00:007
770.12100002014-11-22 12:00:009
780.42300002014-11-26 12:00:000
790.21050002014-11-28 12:00:000
800.75500002014-11-29 12:00:009
810.33100002014-12-02 12:00:004
820.16900002014-12-09 12:00:008
830.13300002014-12-10 12:00:007
840.17000002014-12-12 12:00:003
850.04150002014-12-23 12:00:008
860.06300002014-12-28 12:00:001
870.28500002014-12-29 12:00:008
880.53800002014-12-30 12:00:008
891.17900002014-12-30 12:00:006
900.17700002015-01-07 12:00:008
911.31200002015-01-10 12:00:003
920.24600002015-01-19 12:00:006
930.48000002015-01-19 12:00:001
940.15500002015-01-23 12:00:000
950.47700002015-02-01 12:00:003
960.21400002015-02-02 12:00:005
970.13700002015-02-15 12:00:004
980.31800002015-02-15 12:00:006
990.03600002015-02-28 12:00:002
1000.13400002015-03-11 12:00:004
Out[121]:
Rows: 1-100 of 140 | Columns: 3

See Also

vDataFrame.between_time Filters the data between two time ranges.
vDataFrame.first Filters the data by only keeping the first records.
vDataFrame.filter Filters the data using the input expression.
vDataFrame.last Filters the data by only keeping the last records.