maxframe.dataframe.Series.str.find#
- Series.str.find(sub, start: int = 0, end=None)#
返回 Series/Index 中每个字符串的最低索引。
返回的每个索引对应于子字符串在 [start:end] 范围内完全包含的位置。失败时返回 -1。等效于标准
str.find()。- 参数:
- 返回:
A Series (if the input is a Series) or an Index (if the input is an Index) of the lowest indexes corresponding to the positions where the substring is found in each string of the input.
- 返回类型:
参见
rfind返回每个字符串中的最高索引。
示例
对于 Series.str.find:
>>> import maxframe.dataframe as md >>> ser = md.Series(["_cow_", "duck_", "do_v_e"]) >>> ser.str.find("_").execute() 0 0 1 4 2 2 dtype: int64
对于 Series.str.rfind:
>>> ser = md.Series(["_cow_", "duck_", "do_v_e"]) >>> ser.str.rfind("_").execute() 0 4 1 4 2 4 dtype: int64