# 直接上代碼
import numpy as np
import pandas as pd
title='file_name' # 讀取的文件名
data=np.load(title+'.npy') # 讀取numpy文件
data_df=pd.DataFrame(data) # 利用pandas庫對數據進行格式轉換
# create and writer pd.DataFrame to excel
writer = pd.ExcelWriter(title+'.xlsx') # 生成一個excel文件
data_df.to_excel(writer,'page_1') # 數據寫入excel文件
writer.save() # 保存excel文件