0
我试图通过一个CSV文件读取(行和列像电子表格),并与有它找到给出2个参数如何读取/打印特定的列和行蟒蛇CSV
数据的特定点def main(a, b):
其中a是列,b是行,所以如果我输入“A,2”它会给我列(A)的名称和第2行中的数字。我不知道如何处理这个。
这是我试过
def data(a, b):
file = open("file.csv")
csv_file = csv.reader(file)
for line in csv_file:
array = line.split(",")
first_item = array[0]
a = len(array)
csvfile.seek(0)
reader = csv.reader(csv_file, delimiter=" ")
for row in reader:
b = list(row[a] for a in included_cols)
print(content)
您需要显示您尝试过的内容,您是否能够打开并解析csv文件? –