Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のようなデータファイルがあります。
1,100 2,200 3,-400 4,500
ご覧のとおり、各データ ポイントには 2 つのコンポーネントがあります。
あなたはするかもしれません:
map(int, line.strip().split(','))
これが何をするかです
line.strip()
"1,100\n"
"1,100"
line.split(',') converts
to
map(int, ...)
int
(1, 100)