1
6

More than 3 years have passed since last update.

Python 標準入力で行列表現

Posted at

AtCoderでよく使われる標準入力を使用して3×3の行列を作った

環境 Python 3.7.3


import pandas as pd

s = [input().split() for  i  in range(3)]
N = pd.DataFrame(s,columns=list("123"),index=["Tokyo","Nagoya","Osaka"])
print(N)

入力

9 8 7
6 5 4
3 2 1

出力

image.png

1
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
6