如果只是想把一个DataFrame保存为单独的一个Excel文件,那么直接写: data.to_excel('xxx.excel','sheet1',index=False) 但是这样做,只会保存为单个Excel文件和这个文件中的单个表. 如果先前存在有同名的Excel文件,这样做会把之前的Excel文件覆盖掉,不会起到在原文件中生成新的sheet的作用. 解决方法: if not os.path.exists(mon_excel_path): data_write.to_excel(mon_e
1. 列表 #以下三式等价 c = (a>b and a or b) c = a if a>b else b c = [b, a][a>b] 字符串拼接 ' + '.join('%s,%s'%(a,b) for a,b in zip(list('abc'), range(3))) 'a,0 + b,1 + c,2' 字符查找 'aa' in '大家aa' #True '大家aa'.find('大家') #0 for循环 from itertools import product resu
1.使用 TensorFlow 的建议 Which API(s) should you use? You should use the highest level of abstraction that solves the problem. The higher levels of abstraction are easier to use, but are also (by design) less flexible. We recommend you start with the high