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