1. 程式人生 > >Python將DataFrame增加一列

Python將DataFrame增加一列

from pandas import DataFrame
merge_dt_dict = {'date':date_list,
                'update':update_list,
                'serverip':serverip_list}

data_df = DataFrame(merge_dt_dict)
# add one column add_column and set values=1 
data_df['add_column']  = 1