Adding new column to existing DataFrame in Python pandas

后端 未结 25 1299
你的背包
你的背包 2020-11-22 01:15

I have the following indexed DataFrame with named columns and rows not- continuous numbers:

          a         b         c         d
2  0.671399  0.101208 -         


        
25条回答
  •  时光取名叫无心
    2020-11-22 01:47

    If you want to set the whole new column to an initial base value (e.g. None), you can do this: df1['e'] = None

    This actually would assign "object" type to the cell. So later you're free to put complex data types, like list, into individual cells.

提交回复
热议问题