Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K

pandas.Series.str.match#

Series.str.match(pat,case=True,flags=0,na=<no_default>)[source]#

Determine if each string starts with a match of a regular expression.

Parameters:
patstr or compiled regex

Character sequence or regular expression.

casebool, default True

If True, case sensitive.

flagsint, default 0 (no flags)

Regex module flags, e.g. re.IGNORECASE.

nascalar, optional

Fill value for missing values. The default depends on dtype of thearray. For object-dtype,numpy.nan is used. For the nullableStringDtype,pandas.NA is used. For the"str" dtype,False is used.

Returns:
Series/Index/array of boolean values

See also

fullmatch

Stricter matching that requires the entire string to match.

contains

Analogous, but less strict, relying on re.search instead of re.match.

extract

Extract matched groups.

Examples

>>>ser=pd.Series(["horse","eagle","donkey"])>>>ser.str.match("e")0   False1   True2   Falsedtype: bool

[8]ページ先頭

©2009-2025 Movatter.jp