[英]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')
my values written into rows, but i want to write into CSV in table form, i want:我的值写入行,但我想以表格形式写入 CSV,我想要:
MeanList rata_rataList
value 1| value 2
value a| value b
thank you!谢谢你!
you can use to save your data in CSV or excel.xlsx if you want:如果需要,您可以使用将数据保存在 CSV 或 excel.xlsx 中:
fitur.append(meanList)
fitur.append(rata_rataList)
fitur.to_csv('name_of_excel.csv')
OR要么
fitur.append(meanList)
fitur.append(rata_rataList)
fitur.to_excel('name_of_excel.xlsx')
You can specify delimiter
and header
:您可以指定delimiter
和header
:
np.savetxt('variance/fitur.csv',fitur,header='meanList {:^2s}'.format('rata_rataList'),delimiter="|")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.