pandas读取并写入excel过程当中出现ValueError: source code string cannot contain null bytes

在Macbook Pro上使用Anaconda的Spyder进行pandas操作时,遇到ValueError,提示源代码字符串中不能包含空字节。问题在卸载并重新安装Anaconda后得到解决。
摘要由CSDN通过智能技术生成

pandas读取并写入excel过程当中出现ValueError: source code string cannot contain null bytes

设备:macbookpro
系统:10.14.5
python小白,使用anaconda中spder导入pandas写入excel出现异常,说源代码字符串中不能包含空字符,检查了代码,没有发现代码中出现空字符,纠结了近两天,希望能有大神帮忙看一下。

这是要读区的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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值