python - 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)
解决方案
推荐阅读
- python - How do I check if one list contains 2 elements of another list?
- iot - 无法通过 MQTT 将叶设备连接到 Azure Edge 设备
- c# - 如何在运行时更改 OData EDM 模型
- .net - .NET 4.7.2 如何管理在 .NET Standard 2.0 中编译的依赖项的重定向?
- json - 在 Power BI 中获取 JSON 形状映射视觉对象的映射键表
- javascript - 注册前 Lambda 触发器 autoConfirmUser 不起作用
- nginx - “nginx:[emerg] “events”指令在 /etc/nginx/sites-enabled/myapp.conf:1 中是不允许的” nginX 中的错误
- python - 使用带有 errors='replace' 的 str.decode 仍然会出现错误
- mongodb - MongoDB findOneAndUpdate():使用部分输入进行更新
- gulp - 如何让 gulp.series 运行两个单独运行时成功运行的任务?