📜  pandas 在开头插入列 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:25.331000             🧑  作者: Mango

代码示例1
insert_index = 0
insert_colname = 'new column'
insert_values = [1, 2, 3, 4, 5] # this can be a numpy array too
df.insert(loc=insert_index, column=insert_colname, value=insert_values)