polars.DataFrame.get_column#

DataFrame.get_column(name: str) Series[source]#

Get a single column as Series by name.

Parameters:
namestr

Name of the column to retrieve.

See also

to_series

Examples

>>> df = pl.DataFrame({"foo": [1, 2, 3], "bar": [4, 5, 6]})
>>> df.get_column("foo")
shape: (3,)
Series: 'foo' [i64]
[
        1
        2
        3
]