我的代码之前(两天前)工作正常,但是突然在尝试读取文件时出现以下错误消息。
代码:
def read_csvFile(filename):
return pd.read_csv(filename, sep='|',usecols=cols, engine='python').query('BAL == 0')
with Pool(processes=16) as pool:
df_list = pool.map(read_csvFile, data_files)
final = pd.concat(df_list, ignore_index=True)
错误消息:
RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/home/script.py", line 150, in read_csvFile
return pd.read_csv(filename, sep='|',usecols=cols, engine='python').query('BAL == 0')
File "/home/.local/lib/python3.6/site-packages/pandas/io/parsers.py", line 676, in parser_f
return _read(filepath_or_buffer, kwds)
File "/home/.local/lib/python3.6/site-packages/pandas/io/parsers.py", line 454, in _read
data = parser.read(nrows)
File "/home/.local/lib/python3.6/site-packages/pandas/io/parsers.py", line 1133, in read
ret = self._engine.read(nrows)
File "/home/.local/lib/python3.6/site-packages/pandas/io/parsers.py", line 2431, in read
content = self._get_lines(rows)
File "/home/.local/lib/python3.6/site-packages/pandas/io/parsers.py", line 3181, in _get_lines
new_row = self._next_iter_line(row_num=self.pos + rows + 1)
File "/home/.local/lib/python3.6/site-packages/pandas/io/parsers.py", line 2891, in _next_iter_line
return next(self.data)
OSError: [Errno 5] Input/output error
"""
我该如何解决?