我有以下数据:
data = [
(132603, 'TV Series', 'hbo', 'Chris Rock', datetime.date(2008, 9, 2), datetime.datetime(2019, 2, 6, 2, 16)),
(132605, 'TV Series', 'madman', 'Joanna Lumley', datetime.date(2012, 10, 24), datetime.datetime(2019, 2, 5, 16, 45))
]
然后我创建一个数据框,如下所示:
>>> pd.DataFrame(data)
0 1 2 3 4 5
0 132603 TV Series hbo Chris Rock 2008-09-02 2019-02-06 02:16:00
1 132605 TV Series madman Joanna Lumley 2012-10-24 2019-02-05 16:45:00
在创建数据框时如何指定标题列,例如:
pd.DataFrame(data, headers=['id', 'type','network','start','end'])