Saturday, 15 May 2010

python - Autoincrementing option for Pandas DataFrame index -



python - Autoincrementing option for Pandas DataFrame index -

is there way set alternative auto-incrementing index of pandas.dataframe when adding new rows, or define function managing creation of new indices?

you can set ignore_index=true when append-ing:

in [1]: df = pd.dataframe([[1,2],[3,4]]) in [2]: row = pd.series([5,6]) in [3]: df.append(row, ignore_index=true) out[3]: 0 1 0 1 2 1 3 4 2 5 6

python indexing append row pandas

No comments:

Post a Comment