以下示例是关于Python中包含python从文本文件中读取列数据用法的示例代码,想了解python从文本文件中读取列数据的具体用法?python从文本文件中读取列数据怎么用?python从文本文件中读取列数据使用的例子?那么可以参考以下相关源代码片段来学习它的具体使用方法。
import csv
with open('path/to/file.txt') as inf:
reader = csv.reader(inf, delimiter=" ")
second_col = list(zip(*reader))[1]
本文地址:https://www.itbaoku.cn/snippets/785252.html