Loading...
Loading...
Compare original and translation side by side
scripts/recalc.pyscripts/office/soffice.pyscripts/recalc.pyscripts/office/soffice.pyimport pandas as pdimport pandas as pdundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined
这适用于所有计算——总计、百分比、比率、差异等。当源数据更改时,电子表格应该能够重新计算。
This applies to all calculations—totals, percentages, ratios, differences, etc. The spreadsheet should be able to recalculate when source data changes.python scripts/recalc.py output.xlsxstatuserrors_founderror_summary#REF!#DIV/0!#VALUE!#NAME?python scripts/recalc.py output.xlsxstatuserrors_founderror_summary#REF!#DIV/0!#VALUE!#NAME?undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedscripts/recalc.pypython scripts/recalc.py <excel_file> [timeout_seconds]python scripts/recalc.py output.xlsx 30scripts/recalc.pypython scripts/recalc.py <excel_file> [timeout_seconds]python scripts/recalc.py output.xlsx 30pd.notna()/pd.notna()/{
"status": "success", // 或"errors_found"
"total_errors": 0, // 总错误计数
"total_formulas": 42, // 文件中的公式数量
"error_summary": { // 仅在发现错误时存在
"#REF!": {
"count": 2,
"locations": ["Sheet1!B5", "Sheet1!C10"]
}
}
}{
"status": "success", // or "errors_found"
"total_errors": 0, // Total error count
"total_formulas": 42, // Number of formulas in file
"error_summary": { // Only present if errors are found
"#REF!": {
"count": 2,
"locations": ["Sheet1!B5", "Sheet1!C10"]
}
}
}data_only=Trueload_workbook('file.xlsx', data_only=True)data_only=Trueread_only=Truewrite_only=Truedata_only=Trueload_workbook('file.xlsx', data_only=True)data_only=Trueread_only=Truewrite_only=Truepd.read_excel('file.xlsx', dtype={'id': str})pd.read_excel('file.xlsx', usecols=['A', 'C', 'E'])pd.read_excel('file.xlsx', parse_dates=['date_column'])pd.read_excel('file.xlsx', dtype={'id': str})pd.read_excel('file.xlsx', usecols=['A', 'C', 'E'])pd.read_excel('file.xlsx', parse_dates=['date_column'])