A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://stackoverflow.com/questions/tagged/python-polars below:

Newest 'python-polars' Questions - Stack Overflow

0 votes

0 answers

50 views

Connection string to read and write database with different engines

In polars, there is the engine connextorx for pl.read_database_uri and adbc for pl.write_database. Unfortunately, it's not supported to use the engine adbc to both read and write. In the case of a ...

asked yesterday

0 votes

1 answer

81 views

polars map_batches return_dtype argument for arrays

I am applying a user defined function (UDF) to a polars dataframe using the map_batches function (c.p. https://docs.pola.rs/user-guide/expressions/user-defined-python-functions/#combining-multiple-...

asked 2 days ago

1 vote

1 answer

195 views

How to release memory of intermediate Python-Polars DataFrames in a large dependency graph?

I am performing operations on a directed acyclic graph (DAG) of DataFrames using Polars (eager API). Here’s a simplified example of my workflow: Read parquet files into df1. Use df1 to create df2 and ...

asked Aug 8 at 0:27

3 votes

2 answers

122 views

adjust plotnine legend (swap order)

I'm trying to recreate the following graph with plotnine: And... I'm almost there: I would like the legend order to be switched around My (working) code so far: # imports import polars as pl import ...

asked Aug 6 at 11:07

0 votes

1 answer

71 views

Convert an LDIF file to a tabular DataFrame with Python Polars

I have several LDIF files that look like this: dn: uid=jdoe,ou=People,dc=example,dc=com changetype: add objectClass: inetOrgPerson uid: jdoe cn: John Doe sn: Doe mail:

[email protected]

dn: uid=asmith,...

asked Aug 5 at 6:28

3 votes

3 answers

96 views

Order of columns in a plotnine bar plot using a polars dataframe

I'm quite new to the packages polars and plotnine and have the following code: import polars as pl import polars.selectors as cs from plotnine import * df = pl.read_csv('https://raw.githubusercontent....

asked Aug 4 at 19:59 Horizontal cumulative sum + unnest bug in polars

When I use horizontal cumulative sum followed by unnest, a "literal" column is formed that stays in the schema even when dropped. Here is an example: import polars as pl def ...

asked Aug 4 at 18:49

2 votes

1 answer

115 views

What is the most efficient way to check if a Polars LazyFrame has duplicates?

With the help of claude sonnet 4, I cooked up this function, which I hope does what I asked it to do. def has_duplicates_early_exit(df: pl.LazyFrame, subset: list[str]) -> bool: ""&...

asked Aug 4 at 12:45

0 votes

0 answers

158 views

polars implementation for creating objects selecting specific attributes

The stanza annotation pipeline processes a text and it creates Sentences which in turn comprise of Words. These are objects created by Stanza. I want to select specific attributes of the Word objects ...

asked Aug 4 at 11:51

0 votes

0 answers

45 views

Polars bug using windowed aggregate functions on Decimal type columns

Windowed aggregate functions on Decimal-types move decimals to integers I found a bug in polars (version 1.21.0 in a Python 3.10.8 environment) using windowed aggregate functions. They are not ...

asked Aug 1 at 16:34

2 votes

1 answer

101 views

Why `.first()`, and why before `.over()`, in `with_columns` expression function composition chain

new to Polars, seeking help understanding why part of the function composition for the expression in the .with_columns() snippet below has to be done in that particular order. Specifically, I don't ...

asked Jul 30 at 21:38

2 votes

0 answers

52 views

Rolling quantile with lots of groups

I have a dataset with more than 300 million rows and 7 columns. I want to compute rolling quantiles over lots of groups, but I run out of memory. I use the following code: ( lf.sort('time') ....

asked Jul 30 at 19:03

1 vote

0 answers

81 views

Polars schema_override for Datetimes as string

Issue I have data in form of a list of dicts (see MRE below). To make everything type strict I would always like to pass in the expected schema (dtypes) when I read in this data. This option is given ...

asked Jul 30 at 16:05

3 votes

1 answer

50 views

Unexpected behaviour of some Polars rolling functions when NaN's and Nulls are together

I recently came across some behaviour in the way that some of the Polars rolling functions work that I don't understand. The problem seems to only present itself when there is a NaN (np.nan) as well ...

asked Jul 24 at 14:12 Why does polars kept killing the python kernel when joining two lazy frames and collecting them?

I have one dataframe: bos_df_3 that has about a 30k+ rows and another, taxon_ranked_only, with 6 million when I tried to join them using: matching_df = ( pl.LazyFrame(bos_df_3) .join( other=...

asked Jul 24 at 2:32

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4