@@ -87,17 +87,23 @@ Methods that support User-Defined Functions
87
87
88
88
User-Defined Functions can be applied across various pandas methods:
89
89
90
- +-------------------+------------------------+--------------------------+---------------------------------------------------------------------------+
91
- | Method | Function Input | Function Output | Description |
92
- +===================+========================+==========================+===========================================================================+
93
- | map | Scalar | Scalar | Maps each element to the element returned by the function element-wise |
94
- | apply (axis=0) | Column (Series) | Column (Series) | Apply a function to each column |
95
- | apply (axis=1) | Row (Series) | Row (Series) | Apply a function to each row |
96
- | agg | Series/DataFrame | Scalar or Series | Aggregate and summarizes values, e.g., sum or custom reducer |
97
- | transform | Series/DataFrame | Same shape as input | Transform values while preserving shape |
98
- | filter | Series/DataFrame | Series/DataFrame | Filter data using a boolean array |
99
- | pipe | Series/DataFrame | Series/DataFrame | Chain UDFs together to apply to Series or Dataframe |
100
- +-------------------+------------------------+--------------------------+---------------------------------------------------------------------------+
90
+ +----------------------------+------------------------+--------------------------+---------------------------------------------------------------------------+
91
+ | Method | Function Input | Function Output | Description |
92
+ +============================+========================+==========================+===========================================================================+
93
+ | :meth: `map ` | Scalar | Scalar | Maps each element to the element returned by the function element-wise |
94
+ +----------------------------+------------------------+--------------------------+---------------------------------------------------------------------------+
95
+ | :meth: `apply ` (axis=0) | Column (Series) | Column (Series) | Apply a function to each column |
96
+ +----------------------------+------------------------+--------------------------+---------------------------------------------------------------------------+
97
+ | :meth: `apply ` (axis=1) | Row (Series) | Row (Series) | Apply a function to each row |
98
+ +----------------------------+------------------------+--------------------------+---------------------------------------------------------------------------+
99
+ | :meth: `agg ` | Series/DataFrame | Scalar or Series | Aggregate and summarizes values, e.g., sum or custom reducer |
100
+ +----------------------------+------------------------+--------------------------+---------------------------------------------------------------------------+
101
+ | :meth: `transform ` | Series/DataFrame | Same shape as input | Transform values while preserving shape |
102
+ +----------------------------+------------------------+--------------------------+---------------------------------------------------------------------------+
103
+ | :meth: `filter ` | Series/DataFrame | Series/DataFrame | Filter data using a boolean array |
104
+ +----------------------------+------------------------+--------------------------+---------------------------------------------------------------------------+
105
+ | :meth: `pipe ` | Series/DataFrame | Series/DataFrame | Chain UDFs together to apply to Series or Dataframe |
106
+ +----------------------------+------------------------+--------------------------+---------------------------------------------------------------------------+
101
107
102
108
.. note ::
103
109
Some of these methods are can also be applied to groupby, resample, and various window objects.
0 commit comments