エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
What is the pythonic way to read CSV file data as rows of namedtuples?
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
What is the pythonic way to read CSV file data as rows of namedtuples?
What is the best way to take a data file that contains a header row and read this row into a name... What is the best way to take a data file that contains a header row and read this row into a named tuple so that the data rows can be accessed by header name? I was attempting something like this: import csv from collections import namedtuple with open('data_file.txt', mode="r") as infile: reader = csv.reader(infile) Data = namedtuple("Data", ", ".join(i for i in reader[0])) next(reader) for row i

