Karl Genockey

Results 271 comments of Karl Genockey

Perhaps a possible workaround is to use `.map()` ``` >>> df.with_column(pl.col("Col").map(lambda col: [json.loads(row) for row in col]).flatten()) shape: (2, 1) ┌─────────────────┐ │ Col │ │ --- │ │ struct[2] │...

> Regarding the regex arguments Maybe we should make regex opt-in by adding a regex keyword argument? I am open to a discussion on this. I think this makes sense...

Perhaps this is useful information: Using `.with_dtypes(Some(&schema))` instead of `.with_schema()` generated a different error: ``` `Err` value: NotFound(Owned("Cylinders"))' ``` (The `.with_schema()` docs say *"It is recommended to use with_dtypes instead."*...

Not sure if there is a more direct way - all I could find regarding bitwise was a feature request: https://github.com/pola-rs/polars/issues/5009 ``` >>> df.filter(pl.col("a").map(lambda col: np.bitwise_and(col, 2**2) == 0)) shape:...

It looks like the issue is with `serde_json::to_writer()` https://github.com/pola-rs/polars/blob/master/py-polars/src/dataframe.rs#L395 seems to be codepath taken.

I like some aspects of how duckdb displays the data - trying to keep the column names and type names aligned: ``` >>> duckdb.sql("from df") ┌─────────────────────┬─────────┬───────┬─────────┬─────────┬───┬──────────┬──────────┬──────────┬──────────┬──────────┐ │ time │ stock...

How would I set a schema in this case? The data was coming from elsewhere in the form of tuples. ``` >>> def gen_data(): return ((1, 2), (3, 4), (5,...

I think I may have messed up the title of my post - apologies for that - the struct part is not really relevant. I guess it has to do...

@alexander-beedie I just noticed your comment in https://github.com/pola-rs/polars/issues/6891#issuecomment-1430998111 which means my previous attempt now returns a `list[list[i64]]` column instead of `object` ``` >>> pl.DataFrame({"a": [[(1, 2)], [(3, 4)]]}, schema={"a": pl.List(pl.List(pl.Int64))})...

I see `pl.struct` is on the consideration list. Do you think it could also be a candidate for `**named_exprs`? e.g. ``` pl.struct( one = pl.col(...), two = pl.col(...), three =...