[英]How to save np.append become column just like this pic
fitur.append(meanList)
fitur.append(rata_rataList)
np.savetxt('variance/fitur.csv',fitur, newline='n')
我的值寫入行,但我想以表格形式寫入 CSV,我想要:
MeanList rata_rataList
value 1| value 2
value a| value b
謝謝你!
如果需要,您可以使用將數據保存在 CSV 或 excel.xlsx 中:
fitur.append(meanList)
fitur.append(rata_rataList)
fitur.to_csv('name_of_excel.csv')
要么
fitur.append(meanList)
fitur.append(rata_rataList)
fitur.to_excel('name_of_excel.xlsx')
您可以指定delimiter
和header
:
np.savetxt('variance/fitur.csv',fitur,header='meanList {:^2s}'.format('rata_rataList'),delimiter="|")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.