0

i have a data table like below. The rows come from a data source for every minute but sometimes may come same data or it does not come. For example, i have data for 13:11:49 but do not have 13:12:49, and i have for 13:13:49. What i want to do is that converting this table to 5 minutes and 15 minutes OHLC data. What i can do? The volume columns is cumulative volume.

    SYMBOL CLOSE    VOLUME          DATE

    YKBNK   2.42    74378667.0  2021-09-20 13:11:49 False
    YKBNK   2.41    74384802.0  2021-09-20 13:12:39 False
    YKBNK   2.42    74386152.0  2021-09-20 13:13:39 False
    YKBNK   2.42    74386157.0  2021-09-20 13:14:06 False
    YKBNK   2.42    74389171.0  2021-09-20 13:15:47 False
    YKBNK   2.41    74389407.0  2021-09-20 13:16:31 False
    YKBNK   2.41    74389747.0  2021-09-20 13:17:02 False
    YKBNK   2.42    74389748.0  2021-09-20 13:18:49 False
    YKBNK   2.42    74389948.0  2021-09-20 13:20:19 False
    YKBNK   2.41    74401318.0  2021-09-20 13:21:13 False
    YKBNK   2.42    74401760.0  2021-09-20 13:22:25 False
    YKBNK   2.41    74402128.0  2021-09-20 13:23:26 False
    YKBNK   2.42    74402141.0  2021-09-20 13:24:27 False
    YKBNK   2.41    74403141.0  2021-09-20 13:26:39 False
    YKBNK   2.41    74404760.0  2021-09-20 13:27:43 False
    YKBNK   2.42    74911662.0  2021-09-20 13:29:29 False
    YKBNK   2.42    74921662.0  2021-09-20 13:30:09 False
    YKBNK   2.42    75055072.0  2021-09-20 13:31:48 False
    YKBNK   2.42    75067082.0  2021-09-20 13:32:49 False
    YKBNK   2.41    75069582.0  2021-09-20 13:33:43 False
    YKBNK   2.42    75087153.0  2021-09-20 13:34:50 False
    YKBNK   2.42    75087167.0  2021-09-20 13:35:19 False
    YKBNK   2.42    75587383.0  2021-09-20 13:36:41 False
    YKBNK   2.41    75587658.0  2021-09-20 13:38:38 False
FCTURKEY
  • 13
  • 5
  • have a look at `pandas.Grouper`. You can specify a time frequency in which you want to group the dataframe by: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Grouper.html. – erap129 Sep 21 '21 at 08:13
  • Actually i did what i want with pandas.resample. Now, new problem is that the data is real time data. – FCTURKEY Sep 22 '21 at 06:37

0 Answers0