我有包含13列的csv数据文件。我想拆分两个列值,另一个拆分另一个列来添加一个列。在
def rowfilter(col1, col2):
try:
csv_read = csv.reader(open('items.csv'), delimiter=',')
for row in csv_read:
print(row[int(cols[0]):int(cols[1])])
except FileNotFoundError:
print("File not found")
inputrows = input("Enter columns in the format: col1 col2 ")
rowfilter(inputrows.split()))
要使用csv,通常最简单的方法是使用^{} 模块。它提供易于使用的I/O、选择和操作接口。在
这将打印列。在
相关问题 更多 >
编程相关推荐