Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我编写了一个简单的 python 代码,它从一个大表中提取行并将它们放入数组中。打印后我在终端上得到的结果只是一个包含前两个和最后两个元素的数组
[0.75 0.90 ..., 0.78 0.79]
我尝试使用将输出重定向到 .txt 文件
saveout = sys.stdout outline = open("file.txt", "w") sys.stdout = outline
但我在 txt 文件中遇到了同样的问题。如何将整个数组重定向到文件?