首页 > 解决方案 > excel文件到dat文件的转换不完整

问题描述

当我使用 python 将 excel 文件转换为 dat 时,dat 文件没有 excel 文件的所有行。转换不完整:

import pandas as pd
import numpy as np
a = pd.read_excel('Y:\.......\File.xlsm', sheet_name=2,header=None)
a = a.replace(np.nan, '', regex=True)
b=open('Y:\.......\File.dat','w+')
c=a.to_string(b,index=False,header=None)

标签: pythonexcelpandas

解决方案


推荐阅读