I can read a dataframe like this in pandas (it was originally a TAD file): pd.read_csv('/content/drive/MyDrive/Database Nencini/estrapola_articoli.csv', sep='\t', lineterminator='\r')
How can I do it using polars library?
Reading a file with Polars that has been created as a TAD file and has sep='\t', lineterminator='\r'
Asked
Active
Viewed 99 times
0

coelidonum
- 523
- 5
- 17
1 Answers
2
Check the documentation here: scan_csv. There are separator
and eol_char
arguments that can be used if needed. Equivalent code:
import polars as pl
df = pl.scan_csv('/content/drive/MyDrive/Database Nencini/estrapola_articoli.csv',
separator='\t',
eol_char='\r',
)
I'd be tempted to try it without eol_char
first.
If you want to read the whole file at once into memory (bad idea, your other post said it was huge), you can use read_csv()
instead.

Pep_8_Guardiola
- 5,002
- 1
- 24
- 35