pandas读取并写入excel过程当中出现ValueError: source code string cannot contain null bytes
设备:macbookpro
系统:10.14.5
python小白,使用anaconda中spder导入pandas写入excel出现异常,说源代码字符串中不能包含空字符,检查了代码,没有发现代码中出现空字符,纠结了近两天,希望能有大神帮忙看一下。
import pandas as pd
import sys
input_file = sys.argv[1]
output_file = sys.argv[2]
data_frame = pd.read_excel(input_file, sheet_name='january_2013')
writer = pd.ExcelWriter(output_file)
data_frame.to_excel(writer, sheet_name='jan_13_output', index=False)
writer.save()
Traceback (most recent call last):
File "./b_excel.py", line 14, in <module>
writer = pd.ExcelWriter(output_file