Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/348.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 尝试读取时出现ValueError&;excel文件中的“求和”列_Python_Valueerror - Fatal编程技术网

Python 尝试读取时出现ValueError&;excel文件中的“求和”列

Python 尝试读取时出现ValueError&;excel文件中的“求和”列,python,valueerror,Python,Valueerror,int(“”)抛出该错误 我的建议是检查该单元格值是否包含空字符串: s = sheet.cell_value(row,5) is_positive = int(s) if s else 0 if is_positive>=0: #add logic 你能澄清你的问题吗?此外,除非绝对必要,否则请不要以图像形式共享信息。见:。

int(“”)抛出该错误

我的建议是检查该单元格值是否包含空字符串:

s = sheet.cell_value(row,5)
is_positive = int(s) if s else 0

if is_positive>=0:
    #add logic

你能澄清你的问题吗?此外,除非绝对必要,否则请不要以图像形式共享信息。见:。