In pandas, one can specify the names of a csv with:
pd.read_csv(filename, names = [ 'city', 'pop' ])
How does on do so in Python polars?
In pandas, one can specify the names of a csv with:
pd.read_csv(filename, names = [ 'city', 'pop' ])
How does on do so in Python polars?
You can specify the columns to read using the columns parameter in read_csv. If you want to rename, there is also the parameter new_columns, which accepts a list of column names that you will assign.
See also the reference guide: https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.read_csv.html?highlight=read_csv.