From 39df34d1320e3a6ba9e858c88f2ad41668327c6d Mon Sep 17 00:00:00 2001 From: vincent d warmerdam Date: Tue, 22 Sep 2020 18:29:26 +0200 Subject: [PATCH] Prevent Untitled12.ipynb by adding `pipe`. --- py-polars/pypolars/frame.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/py-polars/pypolars/frame.py b/py-polars/pypolars/frame.py index 140ca25ed0d5..e3c39ed62f5f 100644 --- a/py-polars/pypolars/frame.py +++ b/py-polars/pypolars/frame.py @@ -1,10 +1,9 @@ from __future__ import annotations from .pypolars import PyDataFrame, PySeries -from typing import Dict, Sequence, List, Tuple, Optional, Union +from typing import Dict, Sequence, List, Tuple, Optional, Union, Callable, TextIO, BinaryIO from .series import Series, wrap_s from .datatypes import * import numpy as np -from typing import TextIO, BinaryIO def wrap_df(df: PyDataFrame) -> DataFrame: @@ -341,6 +340,9 @@ def groupby(self, by: Union[str, List[str]]) -> GroupBy: if isinstance(by, str): by = [by] return GroupBy(self._df, by) + + def pipe(self, func: Callable, *args, **kwargs): + return func(self, *args, **kwargs) def join( self,