InputfilesListInplane是文件目录,我可以选择多个数据并从它们各自的文件夹中获取结果。
每次提取 1 个数据时,我的程序都会提取 FieldIP 和 SignalIP。它看起来像这样
Extracted FieldIP and SignalIP (SignalIP contains more data than FieldIP)
FieldIP = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16...]
SignalIP = [1,2,3,4,5,6,7,8,9,10,12,20,40...]
我尝试过的代码,但数据只是保持垂直堆叠。
newfile = "C:/VSMPlots/TabulatedStatsVSM.csv"
with open(newfile, "wb") as csvfile:
for file_path_IP in InputfilesListInplane:
writer = csv.writer(csvfile)
writer.writerow(["FieldIP", "SignalIP"])
writer.writerow([" "])
for field, signal in zip(FieldIP, signalIP):
writer.writerow([field,signal])
writer.writerow("")
我的代码将以这种格式显示
我怎样才能把它变成这种格式