@@ -92,7 +92,7 @@ that cannot be achieved with built-in pandas functions.
92
92
When to use: :meth: `DataFrame.apply ` is suitable when no alternative vectorized method is available, but consider
93
93
optimizing performance with vectorized operations wherever possible.
94
94
95
- Examples of usage can be found :ref: `here<api.dataframe.apply> `.
95
+ Examples of usage can be found :ref: `here <api.dataframe.apply >`.
96
96
97
97
:meth: `DataFrame.agg `
98
98
~~~~~~~~~~~~~~~~~~~~~
@@ -103,7 +103,7 @@ specifically designed for aggregation operations.
103
103
When to use: Use :meth: `DataFrame.agg ` for performing aggregations like sum, mean, or custom aggregation
104
104
functions across groups.
105
105
106
- Examples of usage can be found :ref: `here<api.dataframe.agg> `.
106
+ Examples of usage can be found :ref: `here <api.dataframe.agg >`.
107
107
108
108
:meth: `DataFrame.transform `
109
109
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -113,7 +113,7 @@ It’s generally faster than apply because it can take advantage of pandas' inte
113
113
114
114
When to use: When you need to perform element-wise transformations that retain the original structure of the DataFrame.
115
115
116
- Documentation can be found :ref: `here<api.dataframe.transform> `.
116
+ Documentation can be found :ref: `here <api.dataframe.transform >`.
117
117
118
118
Attempting to use common aggregation functions such as ``mean `` or ``sum `` will result in
119
119
values being broadcasted to the original dimensions:
@@ -176,7 +176,7 @@ for this purpose compared to :meth:`DataFrame.apply` because of its better perfo
176
176
177
177
When to use: Use map for applying element-wise UDFs to DataFrames or Series.
178
178
179
- Documentation can be found :ref: `here<api.dataframe.map> `.
179
+ Documentation can be found :ref: `here <api.dataframe.map >`.
180
180
181
181
:meth: `DataFrame.pipe `
182
182
~~~~~~~~~~~~~~~~~~~~~~
@@ -186,7 +186,7 @@ It is a helpful tool for organizing complex data processing workflows.
186
186
187
187
When to use: Use pipe when you need to create a pipeline of transformations and want to keep the code readable and maintainable.
188
188
189
- Documentation can be found :ref: `here<api.dataframe.pipe> `.
189
+ Documentation can be found :ref: `here <api.dataframe.pipe >`.
190
190
191
191
192
192
Best Practices
0 commit comments