0 votes
0 answers
50 views
Connection string to read and write database with different enginesIn 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 yesterday0 votes
1 answer
81 views
polars map_batches return_dtype argument for arraysI 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 ago1 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:273 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:070 votes
1 answer
71 views
Convert an LDIF file to a tabular DataFrame with Python PolarsI 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:283 votes
3 answers
96 views
Order of columns in a plotnine bar plot using a polars dataframeI'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 polarsWhen 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:492 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:450 votes
0 answers
158 views
polars implementation for creating objects selecting specific attributesThe 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:510 votes
0 answers
45 views
Polars bug using windowed aggregate functions on Decimal type columnsWindowed 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:342 votes
1 answer
101 views
Why `.first()`, and why before `.over()`, in `with_columns` expression function composition chainnew 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:382 votes
0 answers
52 views
Rolling quantile with lots of groupsI 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:031 vote
0 answers
81 views
Polars schema_override for Datetimes as stringIssue 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:053 votes
1 answer
50 views
Unexpected behaviour of some Polars rolling functions when NaN's and Nulls are togetherI 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:32RetroSearch 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