import numpy as np
import pandas as pd
result=np.zeros((4,2))# transform a to pandas DataFrame
result_pd = pd.DataFrame(result, columns=['dt','hang','RSN','PGA'])# create writer to write an excel file------------------------------------------------------------
writer = pd.ExcelWriter('result.xlsx')# write in ro file, 'sheet1' is the page title, float_format is the accuracy of data
result_pd.to_excel(writer,'sheet1', float_format='%.4f')# save file
writer.save()# close writer
writer.close()