Questions tagged [python-polars]

Polars is a DataFrame library/in-memory query engine.

The Polars core library is written in Rust and uses Arrow, the native arrow2 Rust implementation, as its foundation. It offers Python and JavaScript bindings, which serve as a wrapper for functionality implemented in the core library.

Links

1331 questions
-1
votes
2 answers

polars dataframe TypeError: must be real number, not str

so bascially i changed panda.frame to polars.frame for better speed in yolov5 but when i run the code, it works fine till some point (i dont exactly know when error occurs) and it gives me TypeError: must be real number, not str. running it with…
wookidookik123
  • 79
  • 2
  • 10
-1
votes
1 answer

ewm_mean ignore nan

Given a series with possible NaN values, how does one tell polars to ignore the NaN values? That is, treat the NaN value as if it weren't in the DataFrame, and use the same value for the mean as in the cell before the NaN value. To be 100% specific,…
Test
  • 962
  • 9
  • 26
-1
votes
1 answer

Polars: Pivoting by Int64 column not keeping numeric order

I have a column called VERSION_INDEX which is Int64 and is a proxy for keeping a list of semantic software versions ordered such that 0.2.0 comes after 0.13.0. When I pivot, the column names created from the pivot are sorted…
rchitect-of-info
  • 1,150
  • 1
  • 11
  • 23
-1
votes
1 answer

groupby_dynamic with selfdesigned index

how to make something like groupby_dynamic but can support a user-defined index the groupby_dynamic can support timeindex to make a operation as a resample but can only support the range of a non-duplicate way, such as time day1 9:00 day1…
yutiansut
  • 11
  • 5
-2
votes
0 answers

How to run polars data frame in batches

I have very big parquet file with 25+Million rows and loaded the file using polars and did some transformation. But getting out of memory error during transformations. So trying to run in batches. below is sample data and code df =…
Hari
  • 299
  • 4
  • 12
-2
votes
1 answer

groupby transform lambda ewm using polars

I'm trying to find faster alternative for the following code using polars df['ewm'] = df.groupby(['outlet', 'product'])['sales'].transform(lambda x: x.shift(shift).ewm(com=10).mean()) Please find MWE example below df = pd.DataFrame({"outlet": [1,…
Wiama Daya
  • 37
  • 4
-2
votes
1 answer

Search large single-line text file in python for a string

I'm trying to write a program to search an extremely large text file for specific strings, and then return the string as well as a certain amount of characters before and after it from within the file, and to be able to quickly do this thousands of…
-2
votes
2 answers

Why is it parsing datetime like this?

I've been recently using Polars for a project im starting to develop, ive come across several problems but with the info here and in the docs i have solved those issues. My issue: When I save the dataframe it stores datetime data like…
1 2 3
88
89