Skip to content

Commit 2053ec9

Browse files
committed
docs: clarify usage of col() and column() in DataFrame examples
1 parent 00d21a9 commit 2053ec9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/source/user-guide/dataframe/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,21 +142,21 @@ For such methods, you can pass column names directly:
142142

143143
.. code-block:: python
144144
145-
from datafusion import col, column, functions as f
145+
from datafusion import col, functions as f
146146
147147
df.sort('id')
148148
df.aggregate('id', [f.count(col('value'))])
149149
150-
The same operation can also be written with an explicit column expression:
150+
The same operation can also be written with explicit column expressions, using either ``col()`` or ``column()``:
151151

152152
.. code-block:: python
153153
154154
from datafusion import col, column, functions as f
155155
156156
df.sort(col('id'))
157-
df.aggregate(col('id'), [f.count(col('value'))])
157+
df.aggregate(column('id'), [f.count(col('value'))])
158158
159-
Note that ``column()`` is an alias of ``col()``, so you can use either name.
159+
Note that ``column()`` is an alias of ``col()``, so you can use either name; the example above shows both in action.
160160

161161
Whenever an argument represents an expression—such as in
162162
:py:meth:`~datafusion.DataFrame.filter` or

0 commit comments

Comments
 (0)