KOTA ITO

Generation

generate functionSun, 11 Dec 2022

csvファイルを読み込む時に、指定した列を文字列として読み込む

def read_csv(file, cols): with open(file, "r") as f: reader = csv.reader(f) rows = [row for row in reader] return [str(row[col]) for row in rows]

Questions about programming?Chat with your personal AI assistant