LoginSignup
6
6

More than 5 years have passed since last update.

「データフレームの結合、空の列の追加、一行ずつデータを取り出して、値を入力。」がしたい。

Last updated at Posted at 2018-05-04

「データフレームの結合、空の列の追加、一行ずつデータを取り出して、値を入力。」
がやりたいこと。
何度やっても、ググらないとできないので、メモ。

1、DFを結合するときにはいつもお世話になっています。
http://sinhrks.hatenablog.com/entry/2015/01/28/073327

3、空の列を追加して、
http://nekoyukimmm.hatenablog.com/entry/2015/04/10/133917

3、そして、Interrowをfor文で回して、1行ずつアクセスし、if条件書いて、空の列に値を埋めていく、

for index, row in df.iterrows():
    if row[columnName] == something:
        df.at[index, columnName] = "What I want input"

6
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
6
6