Symbols have mismatching columns error which loading data into vectorbt from a pandas dataframe

126 Views Asked by At

I have downloaded historical data and stored in a csv file on disk. I am loading this csv file in a pandas dataframe. From there on, I am trying to load this dataframe into vectorbt. Here is my code

import vectorbt as vbt
import pandas as pd

prices_1m = pd.read_csv('../hist/eurusd_m1.csv',
                        index_col='timestamp')

prices_1m.index = pd.to_datetime(prices_1m.index)



vprices_m1 = vbt.Data.from_data(prices_1m)
#vprices_m1 = vbt.YFData.download('AAPL', missing_index='drop')

print(prices_1m.items())

But I am getting the following error when I run this code

ValueError: Symbols have mismatching columns

What am I doing here?

1

There are 1 best solutions below

0
On

For what I undestand, you must imput a dictionary to the from_data() funct something like this in your case:

vprices_m1 = vbt.Data.from_data({'eurusd':prices_1m})