Pandas version of rbind

前端 未结 4 719
野的像风
野的像风 2021-02-01 12:03

In R, you can combine two dataframes by sticking the columns of one onto the bottom of the columns of the other using rbind. In pandas, how do you accomplish the same thing? It

4条回答
  •  离开以前
    2021-02-01 12:13

    Ah, this is to do with how I created the DataFrame, not with how I was combining them. The long and the short of it is, if you are creating a frame using a loop and a statement that looks like this:

    Frame = Frame.append(pandas.DataFrame(data = SomeNewLineOfData))
    

    You must ignore the index

    Frame = Frame.append(pandas.DataFrame(data = SomeNewLineOfData), ignore_index=True)
    

    Or you will have issues later when combining data.

提交回复
热议问题