Series.str.partition()

pandas.Series.str.partition

Series.str.partition(pat=' ', expand=True)

Split the string at the first occurrence of sep, and return 3 elements containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return 3 elements containing the string itself, followed by two empty strings.

登录查看完整内容
Parameters:

pat : string, default whitespace

String to split on.

expand : bool, default True

  • If True, return DataFrame/MultiIndex expanding dimensionality.
  • If False, return Series/Index.