I have a pandas data frame that looks something like this:
A B C
0 1 2 3
1 4 5 6
2 7 8 9
And I would like to add row 0 to the end of the data frame and to get a new data frame that looks like this:
A B C
0 1 2 3
1 4 5 6
2 7 8 9
3 1 2 3
What can I do in pandas to do this?
You can try:
df = df.append(df.iloc[0], ignore_index=True)
这篇关于从数据框的开头向 pandas 数据框的末尾添加值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!