如何使用python按列对xls文件进行排序并将其写入另一个包含整行的文件?
如何使用 python 按列对 xls 文件进行排序并将其写入另一个包含整行的文件? xls 文件必须按列排序。排序后必须将其写入另一个文件中。
how to sort xls file column wise and write it to another file with entire row using python ? the xls file has to be sorted column wise. And after sorting it has to be writen into another file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
怎么样:
我的错,我猜你总是可以导出为 csv。如果您想坚持使用 xls,可以使用 xlrd 和 xlwt。我对此没有做过太多工作,但我确实有一个来自我不久前必须完成的任务的示例。就是这样(并不是 100% 好,因为每列的单元格标题将存储为输出文件中数据的第一行):
How about:
My bad, well you can always export as csv i guess. If you want to stick to xls you can use xlrd and xlwt. I haven't worked much with this but I do have a sample from a task I had to do a while back. Here it is(not that is not 100% good because the cell titles for each columns will be stored as the first row on data on the output file):