(self, func, *args, **kwargs)
| 2558 | |
| 2559 | @derived_from(pd.DataFrame) |
| 2560 | def pipe(self, func, *args, **kwargs): |
| 2561 | if isinstance(func, tuple): |
| 2562 | func, target = func |
| 2563 | if target in kwargs: |
| 2564 | raise ValueError( |
| 2565 | "%s is both the pipe target and a keyword argument" % target |
| 2566 | ) |
| 2567 | kwargs[target] = self |
| 2568 | return func(*args, **kwargs) |
| 2569 | else: |
| 2570 | return func(self, *args, **kwargs) |
| 2571 | |
| 2572 | def sample(self, n=None, frac=None, replace=False, random_state=None): |
| 2573 | """Random sample of items |