MCPcopy Create free account
hub / github.com/dask/dask / match

Method match

dask/bag/core.py:336–353  ·  view source on GitHub ↗

Filter strings by those that match a pattern. Examples -------- >>> import dask.bag as db >>> b = db.from_sequence(['Alice Smith', 'Bob Jones', 'Charlie Smith']) >>> list(b.str.match('*Smith')) ['Alice Smith', 'Charlie Smith'] See Also

(self, pattern)

Source from the content-addressed store, hash-verified

334 raise
335
336 def match(self, pattern):
337 """Filter strings by those that match a pattern.
338
339 Examples
340 --------
341
342 >>> import dask.bag as db
343 >>> b = db.from_sequence(['Alice Smith', 'Bob Jones', 'Charlie Smith'])
344 >>> list(b.str.match('*Smith'))
345 ['Alice Smith', 'Charlie Smith']
346
347 See Also
348 --------
349 fnmatch.fnmatch
350 """
351 from fnmatch import fnmatch
352
353 return self._bag.filter(partial(fnmatch, pat=pattern))
354
355
356def robust_wraps(wrapper):

Callers 15

ignore_warningFunction · 0.80
unsupported_argumentsFunction · 0.80
key_splitFunction · 0.80
shortenMethod · 0.80
test_string_namespaceFunction · 0.80
test_late_dtypesFunction · 0.80
get_labelFunction · 0.80
get_shapeFunction · 0.80

Calls 1

filterMethod · 0.80