LoginSignup
0
1

More than 1 year has passed since last update.

備忘録1

Posted at

自分の備忘録を載せておきます。

データフレームから座標を順に読み取ってリストに格納する方法

df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]}) #dfの作成
df_list = [] #空リスト作成
for n in range(3):
    result = [df.iloc[0+n,0],df.iloc[0+n,1]]
    df_list.append(result)

辞書型からリストに変換する方法

d = {'a': 1, 'b': 2, 'c': 3}
keys = list(d.keys())
values = list(d.values())
0
1
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
0
1