# 将独立测试集写入文件
path_output = "/hy-tmp/Data/LC25000/test.tsv"
with open(path_output, "w") as fo:
fo.write("patch_name\tlabel\n")
for i in range(len(X_test)):
# print(X_test.iloc[i])
fo.write(X_test.iloc[i])
fo.write("\t")
fo.write(str(y_test.iloc[i]))
fo.write("\n")
【Python-Pandas】<class ‘pandas.core.series.Series‘>写入文件
于 2024-07-06 20:18:19 首次发布