use sep='s*,s*'
so that you will take care of spaces in column-names:
transactions = pd.read_csv('transactions.csv', sep=r's*,s*',
header=0, encoding='ascii', engine='python')
alternatively you can make sure that you don't have unquoted spaces in your CSV file and use your command (unchanged)
prove:
print(transactions.columns.tolist())
Output:
['product_id', 'customer_id', 'store_id', 'promotion_id', 'month_of_year', 'quarter', 'the_year', 'store_sales', 'store_cost', 'unit_sales', 'fact_count']
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…