界面优化
This commit is contained in:
@ -168,7 +168,10 @@ class Step4Panel(QWidget):
|
||||
|
||||
try:
|
||||
rows_to_preview = max(1, self.preview_rows_spin.value())
|
||||
df = pd.read_csv(csv_path, nrows=rows_to_preview)
|
||||
# dtype=object 确保所有列以字符串读取,避免空值/混合类型导致 dtype 报错
|
||||
df = pd.read_csv(csv_path, nrows=rows_to_preview, dtype=object)
|
||||
# fillna 在 PandasTableModel.__init__ 中已执行,此处再次防御性处理
|
||||
df = df.fillna('')
|
||||
if df.empty:
|
||||
self.reset_preview("CSV文件为空")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user