问题
In python2 i could go from this pandas series
0
0 [a,b,c]
with s.str.split(',',expand=True) into this:
0 1 2
0 a b c
and now (ipython3) i cant, because lack of "expand" argument. How I can do it in other way?
回答1:
You should check your environment's pandas version. According to the pandas docs, expand was recently added so it looks like you regressed your version somehow.
expand : bool, default False If True, return DataFrame/MultiIndex expanding dimensionality. If False, return Series/Index. New in version 0.16.1.
Based on the old docs it looks like you can do the same thing by specifying the return_type='frame'
parameter.
来源:https://stackoverflow.com/questions/35567162/split-got-an-unexpected-keyword-argument-expand