Я читаю файл .csv в dataframe (CorpActionsDf), но когда я печатаю главу CorpActionsDf я вижу, что я пропускаю первую строку данных:отсутствует первую строку из CSV
глава .cvs данные:
BBG.XAMS.ASML.S 24/04/2015 0.7 Annual Regular Cash
BBG.XAMS.ASML.S 25/04/2014 0.61 Annual Regular Cash
BBG.XAMS.ASML.S 26/04/2013 0.53 Annual Regular Cash
BBG.XAMS.ASML.S 26/11/2012 9.18 None Return of Capital
BBG.XAMS.ASML.S 27/04/2012 0.46 Annual Regular Cash
глава CorpActionsDf:
date factor_value reference factor
unique_id
BBG.XAMS.ASML.S 25/04/2014 0.61 Annual Regular Cash
BBG.XAMS.ASML.S 26/04/2013 0.53 Annual Regular Cash
BBG.XAMS.ASML.S 26/11/2012 9.18 None Return of Capital
BBG.XAMS.ASML.S 27/04/2012 0.46 Annual Regular Cash
BBG.XAMS.ASML.S 26/04/2011 0.40 Annual Regular Cash
Как вы можете увидеть первую строку данных в формате CSV отсутствует в dataframe.
BBG.XAMS.ASML.S 24/04/2015 0.7 Annual Regular Cash
Мой код выглядит следующим образом:
def getCorpActionsData(rawStaticDataPath):
pattern = 'CorporateActions'+ '.csv'
staticPath = rawStaticDataPath
with open(staticPath+pattern,'rt') as f:
#staticDf=pd.read_csv(f,engine='c',header=0,index_col=0, parse_dates=True, infer_datetime_format=True,usecols=(0,3))
CorpActionsDf=pd.read_csv(f,engine='c',header=0,index_col=0, parse_dates=True, infer_datetime_format=True,names=['unique_id', 'date','factor_value','reference','factor'])
print('CorpActionsDf')
print(CorpActionsDf.head())
Любой иметь представление о том, что мне не хватает?
Благодаря