Skip to content

Commit 527042f

Browse files
committed
Update documentation to include 'column()' alias for 'col()' in DataFrame examples
1 parent b6a0204 commit 527042f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

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

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

152152
.. code-block:: python
153153
154-
from datafusion import col, functions as f
154+
from datafusion import col, column, functions as f
155155
156156
df.sort(col('id'))
157157
df.aggregate(col('id'), [f.count(col('value'))])
158158
159+
Note that ``column()`` is an alias of ``col()``, so you can use either name.
160+
159161
Whenever an argument represents an expression—such as in
160162
:py:meth:`~datafusion.DataFrame.filter` or
161163
:py:meth:`~datafusion.DataFrame.with_column`—use ``col()`` to reference columns

0 commit comments

Comments
 (0)