def str_split(arr, pat=None, n=None):
 if (pat is None):
  if ((n is None) or (n == 0)):
   n = (-1)
  f = (lambda x: x.split(pat, n))
 elif (len(pat) == 1):
  if ((n is None) or (n == 0)):
   n = (-1)
  f = (lambda x: x.split(pat, n))
 else:
  if ((n is None) or (n == (-1))):
   n = 0
  regex = re.compile(pat)
  f = (lambda x: regex.split(x, maxsplit=n))
 res = _na_map(f, arr)
 return res

def str_split ( arr , pat = None , n = None ) : if ( pat is None ) : if ( ( n is None ) or ( n == 0 ) ) : n = ( - 1 ) f = ( lambda x : x . split ( pat , n ) ) elif ( len ( pat ) == 1 ) : if ( ( n is None ) or ( n == 0 ) ) : n = ( - 1 ) f = ( lambda x : x . split ( pat , n ) ) else : if ( ( n is None ) or ( n == ( - 1 ) ) ) : n = 0 regex = re . compile ( pat ) f = ( lambda x : regex . split ( x , maxsplit = n ) ) res = _na_map ( f , arr ) return res
split each string in the series/index by given pattern .