Skip to content

Commit

Permalink
fix:读取报表错误 pandas.errors.ParserError: Error tokenizing data. C error
Browse files Browse the repository at this point in the history
  • Loading branch information
EightyDollars committed Nov 15, 2023
1 parent 58c7ebd commit 68d323f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions arknights_mower/solvers/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def has_record(self):
if os.path.exists(self.record_path) is False:
logger.debug("基报不存在")
return False
df = pd.read_csv(self.record_path, encoding='gbk')
df = pd.read_csv(self.record_path, encoding='gbk', on_bad_lines='skip')
for item in df.iloc:
if item[0] == self.date:
return True
Expand All @@ -159,5 +159,3 @@ def get_report_data():
print(data)
except PermissionError:
logger.info("report.csv正在被占用")


2 changes: 1 addition & 1 deletion arknights_mower/solvers/skland.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def has_record(self, phone: str):
if os.path.exists(self.record_path) is False:
logger.debug("无森空岛记录")
return False
df = pd.read_csv(self.record_path, header=None, encoding='gbk')
df = pd.read_csv(self.record_path, header=None, encoding='gbk',on_bad_lines='skip')
for item in df.iloc:
if item[0] == datetime.datetime.now().strftime("%Y/%m/%d"):
if item[1].astype(str) == phone:
Expand Down

0 comments on commit 68d323f

Please sign in to comment.