pandas 合并series为dataframe

直接把series的list用pd.DataFrame()转换就可以了。

d
'''
[id_               AGENT0000000000
grid                           88
timestamp     2021-04-26 00:01:00
pos_x                     448.457
pos_y                     204.423
bearing                    4.1132
category                  WALKING
speed_rank                      1
speed                         1.4
dtype: object, id_               AGENT0000000000
grid                           48
timestamp     2021-04-26 00:02:00
pos_x                      415.22
pos_y                     127.278
bearing                   4.30558
category                  WALKING
speed_rank                      1
speed                         1.4
dtype: object, id_               AGENT0000000000
grid                            8
timestamp     2021-04-26 00:03:00
pos_x                     426.493
pos_y                     44.0383
bearing                     4.847
category                  WALKING
speed_rank                      1
speed                         1.4
dtype: object, id_               AGENT0000000000
grid                          -12
timestamp     2021-04-26 00:04:00
pos_x                      428.85
pos_y                    -39.9286
bearing                   4.74046
category                  WALKING
speed_rank                      1
speed                         1.4
dtype: object, id_               AGENT0000000000
grid                          -52
timestamp     2021-04-26 00:05:00
pos_x                     428.115
pos_y                    -123.925
bearing                   4.70363
category                  WALKING
speed_rank                      1
speed                         1.4
dtype: object, id_               AGENT0000000000
grid                          -92
timestamp     2021-04-26 00:06:00
pos_x                     410.275
pos_y                    -206.009
bearing                   4.49838
category                  WALKING
speed_rank                      1
speed                         1.4
dtype: object, id_               AGENT0000000000
grid                         -113
timestamp     2021-04-26 00:07:00
pos_x                     397.043
pos_y                     -288.96
bearing                   4.55421
category                  WALKING
speed_rank                      1
speed                         1.4
dtype: object, id_               AGENT0000000000
grid                         -153
timestamp     2021-04-26 00:08:00
pos_x                      380.11
pos_y                    -371.236
bearing                   4.50941
category                  WALKING
speed_rank                      1
speed                         1.4
dtype: object, id_               AGENT0000000000
grid                         -193
timestamp     2021-04-26 00:09:00
pos_x                     390.828
pos_y                    -454.549
bearing                   4.84034
category                  WALKING
speed_rank                      1
speed                         1.4
dtype: object, id_               AGENT0000000000
grid                         -212
timestamp     2021-04-26 00:10:00
pos_x                     428.143
pos_y                    -529.806
bearing                   5.17269
category                  WALKING
speed_rank                      1
speed                         1.4
dtype: object]
'''
df = pd.DataFrame(d)
'''

id_	grid	timestamp	pos_x	pos_y	bearing	category	speed_rank	speed
0	AGENT0000000000	88	2021-04-26 00:01:00	448.456657	204.423017	4.113199	WALKING	1	1.4
1	AGENT0000000000	48	2021-04-26 00:02:00	415.219566	127.278375	4.305581	WALKING	1	1.4
2	AGENT0000000000	8	2021-04-26 00:03:00	426.492871	44.038285	4.847001	WALKING	1	1.4
3	AGENT0000000000	-12	2021-04-26 00:04:00	428.850296	-39.928628	4.740457	WALKING	1	1.4
4	AGENT0000000000	-52	2021-04-26 00:05:00	428.114793	-123.925408	4.703633	WALKING	1	1.4
5	AGENT0000000000	-92	2021-04-26 00:06:00	410.274789	-206.009111	4.498378	WALKING	1	1.4
6	AGENT0000000000	-113	2021-04-26 00:07:00	397.043201	-288.960453	4.554211	WALKING	1	1.4
7	AGENT0000000000	-153	2021-04-26 00:08:00	380.109717	-371.235948	4.509409	WALKING	1	1.4
8	AGENT0000000000	-193	2021-04-26 00:09:00	390.828151	-454.549303	4.840338	WALKING	1	1.4
9	AGENT0000000000	-212	2021-04-26 00:10:00	428.142720	-529.806349	5.172694	WALKING	1	1.4
'''
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值