Hi,

I am learning Python and pandas. Is this an expected behavior ?

serie= pd.Series(['a b', 'a b', 'a b', 'a b', 'a b', 'a b'])
serie_splited  =serie.str.split()
serie_splited  = pd.Series.str.split(serie)

serie.str.split() works correctly.

and pd.Series.str.split(serie) gets an error :

File "D:\Dev2\Anaconda3\lib\site-packages\pandas\core\strings.py", line 160, in _map if not len(arr):

TypeError: len() of unsized object

Comment From: jreback

pd.Series.str.split is a class method and is not available, you almost alway need to create an instance, e.g. Series(data).str.split()

Comment From: sirhc78

Ok thank you. As it is not a "@staticmethod", it makes sense.