Skip to content

Tag: python-polars

Polars: settings not to display ellipsis

Polars chops some text instead of showing all text like the following Link Name https://… name1 https://… name2 I want Polars to show all text of Link Col How can I do that? Answer You should change pl.Config() settings – pl.Config.set_fmt_str_lengths(n) (see doc) If you just want to check, …

How to roll up duplicate observation in Python polars?

I have a data frame as- Here I would like to find out duplicates considering last_name and firs_name columns and if any duplicates found their respective ssn needs to be rolled up with semicolon(;) if SSN are not different. if SSN are also same only one SSN needs to be present. the expected output as: Here si…

Python Polars Parse Date from Epoch

How does one convert a column of i64 epoch strings into dates in polars? I’ve got a column of i64 representing seconds since epoch and I’d like to parse them into polars native datetimes. Answer Polars’ Datetime is represented as unix epoch in either, nanoseconds, microseconds or millisecond…