Created
September 18, 2017 07:32
-
-
Save utahka/367704b5ef4500048ade72d03ee06886 to your computer and use it in GitHub Desktop.
空のデータフレームを作って、レコードを追加していくパターン
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
cols = ['col1', 'col2'] | |
df = pd.DataFrame(index=[], columns=cols) | |
record = pd.Series(['hoge', 'fuga'], index=df.columns) | |
for _ in range(5): | |
df = df.append(record, ignore_index=True) | |
print(df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment