[已解决]Series object has no attribute explode

报错代码

s = pd.Series([[1, 2, 3], 'foo', [], [3, 4]])
s

0 [1, 2, 3]
1 foo
2 []
3 [3, 4]
dtype: object

s.explode()

AttributeError: 'Series' object has no attribute 'explode'

解决: 升级pandas至0.25以及以上版本

posted @ 2019-09-20 10:48  hank-li  阅读(4718)  评论(0编辑  收藏  举报