Help us understand the problem. What is going on with this article?

pandasで動的に新たなデータフレームを作る

perl, Ruby, JSあたりの、
自由な辞書構造の感覚で、pandasを扱いたいときに、
どうしてもキー(index)がない!という問題になるように思います。

まず、

AAA["hoge"].iloc[n] = "hogehoge"

みたいな発想を一度捨てるところから始まります。

# まずcolumnだけのdfを用意
df = pd.DataFrame( columns=['A','B'] )

# 行を作る
tmp_se = pd.Series( [ i, i*i ], index=list_df.columns )

# dfに行をレコードとして追加
df = df.append( tmp_se, ignore_index=True )

以下を参考に致しました。
https://qiita.com/567000/items/d8a29bb7404f68d90dd4

c_c_c_c
少しずつアウトプットして思考を整理していきます。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした