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)
| 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 | |
| 356 | def robust_wraps(wrapper): |