import numpy as npimport pandas as pdA = np.array([[1, 2], [3, 2], [1, 1], [3, 5], [5,2]])data = pd.Dataframe(A)writer = pd.ExcelWriter('A.xlsx')# 写入Excel文件data.to_excel(writer, 'page_1', float_format='%.5f')# ‘page_1’是写入excel的sheet名writer.save()writer.close()
numpy对大量excel表内容处理
numpy(或pandas)处理csv与excel方法