For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Extend CSV feeder with string column
-
Hello,
I'm using csv data with string column, such as:
datetime | symbol | open | high | ....
The
symbol
column is ofstr
type, which cannot be converted tofloat
.Core code in backtrader shows that it tries to convert all columns to
float
value.So is there an easy way to use string column in backtrader, or any advice on doing so?
Thanks.
-
@mttax said in Extend CSV feeder with string column:
So is there an easy way to use string column in backtrader, or any advice on doing so?
No. This is not
pandas
. your best option is to load the data usingpandas
into aDataframe
and then using the current data index, fetch the string from the dataframe.