How can I change the dataframe of my stock data (Python)?

  • I have the following python script allowing me to print my data as an array. This is for a 1 min interval (In Unix Time). Assuming I have a much larger data, how can I dynamically change/convert my data to a different timeframe (e.g., 5 min, 1 hr, day, week, etc)?

    The above python script creates the output of the following:

    Code
    id_array [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
    symbol_array ['UAL', 'UAL', 'UAL', 'UAL', 'UAL', 'UAL', 'UAL', 'UAL', 'UAL', 'UAL', 'UAL']
    time_array [1589558400000, 1589558340000, 1589558280000, 1589558220000, 1589558160000, 1589558100000, 1589558040000, 1589557980000, 1589557920000, 1589557860000, 1589557800000]
    opening_array [19.89, 19.92, 19.92, 19.93, 19.96, 19.9713, 19.98, 20.0, 20.0, 20.02, 19.98]
    closing_array [19.92, 19.9, 19.925, 19.925, 19.93, 19.965, 19.97, 19.98, 20.0, 20.0062, 20.025]
    highest_array [19.97, 19.93, 19.93, 19.94, 19.9677, 19.98, 19.99, 20.01, 20.01, 20.035, 20.03]
    lowest_array [19.89, 19.89, 19.92, 19.92, 19.93, 19.96, 19.97, 19.97, 19.99, 20.0, 19.97]
    volume_array [360003, 346685, 85980, 91302, 137609, 55953, 51497, 107351, 75173, 50913, 123708]
  • The last reply was more than 365 days ago, this thread is most likely obsolete. It is recommended to create a new thread instead.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!