We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
then
.pipe
1 parent 6dbd74e commit cc5aa74Copy full SHA for cc5aa74
janitor/functions/then.py
@@ -2,14 +2,25 @@
2
from typing import Callable
3
import pandas_flavor as pf
4
import pandas as pd
5
+from janitor.utils import refactored_function
6
7
8
+@pf.register_dataframe_method
9
+@refactored_function(
10
+ message="This function will be deprecated in a 1.x release. "
11
+ "Kindly use `pd.DataFrame.pipe` instead."
12
+)
13
@pf.register_dataframe_method
14
def then(df: pd.DataFrame, func: Callable) -> pd.DataFrame:
15
"""Add an arbitrary function to run in the `pyjanitor` method chain.
16
17
This method does not mutate the original DataFrame.
18
19
+ !!!note
20
+
21
+ This function will be deprecated in a 1.x release.
22
+ Please use `pd.DataFrame.pipe` instead.
23
24
Examples:
25
A trivial example using a lambda `func`.
26
0 commit comments