replace rows in a pandas data frame

前端 未结 2 925
Happy的楠姐
Happy的楠姐 2020-12-17 18:36

I want to start with an empty data frame and then add to it one row each time. I can even start with a 0 data frame data=pd.DataFrame(np.zeros(shape=(10,2)),column=[\

2条回答
  •  旧巷少年郎
    2020-12-17 18:45

    If you are replacing the entire row then you can just use an index and not need row,column slices. ...

    data.loc[2]=5,6

提交回复
热议问题