When importing my .txt file, I am getting the following error:
Can't convert 'int' object to str implicitly
I import my .txt file as follows:
activityHeaders = ['Type', 'AccountID', 'ConID', 'SecurityID', 'Symbol', 'BBTicker', 'Currency', 'BaseCurrency', 'TradeDate', 'SettleDate', 'TransactionType', 'Quantity', 'UnitPrice', 'GrossAmount', 'SECFee', 'Commission', 'NetInBase', 'FXRatetoBase', 'Other1', 'Other2', 'Description']
dfActivity = pd.read_csv(activityFileUrl, skiprows=[1], header=activityHeaders, error_bad_lines=False)
and my .txt file looks as follows:
"H","I000000","Activity","20100407","16:02:38","20100329","1.0"
"D","I000000","","","","","CAD","EUR","20100329","20100329","WITH","0","0","-14.88","0","0","0","-14.88","-10.8158","",,"CASH TRANSFER (INTERNAL)"
"D","I000000","","","","","AUD","EUR","20100328","20100328","ADJ","0","0","4","0","0","0","4","2.7211","",,"CLIENT FEE (U000001, Commission)"
"D","U000001","37036548","DE000A0F6MD5","PRA","STK","EUR","EUR","20100329","20100331","SELL","-300","7.776","-2332.8","0","-6","0","2326.8","2326.8","405346125","FI","TRADE PRAKTIKER BAU-UND HEIMWERK A"
I don't understand where the int could come from. Note that I skip the first and last row using the skiprows and error_bad_lines. I put header also to None and it returned the same error.