For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
How to ignore 2 headers in a GenericCSV
-
I've got headers on True but it seems to only ignore the first header and read 'Date' as an actual data -
I didn't try it myself, but probably the following may work:
class MyGenericCSVData(bt.GenericCSVData): def start(self): super(MyGenericCSVData, self).start() if self.p.headers: self.f.readline() # skip the second header (the first one was skipped in GenericCSVData start method) class MyGenericCSV(bt.GenericCSV): DataCls = MyGenericCSVData
Thanks
Vlad -
The subclass from @vladisld does for sure work.
You may also read the file with
pandas.read_csv
, skip what you need and pass it toCerebro
as aPandasData
feed.