Comments (3)
Alternatively, if someone did want to use fields from another struct, perhaps an issue request for .struct.with_context()
? Although I'm not sure how far Ritchie wants to go with treating structs as miniframes.
from polars.
Can I close it now (with #16402 merged)?
from polars.
I think you can.
df = pl.DataFrame({
"item": [
{"name": "John", "age": 30, "car": None},
{"name": "Alice", "age": 65, "car": "Volvo"},
]
})
df.select(
pl.col("item").struct.with_fields(
pl.field("name").str.to_uppercase()
)
)
# shape: (2, 1)
# ┌──────────────────────┐
# │ item │
# │ --- │
# │ struct[3] │
# ╞══════════════════════╡
# │ {"JOHN",30,null} │
# │ {"ALICE",65,"Volvo"} │
# └──────────────────────┘
from polars.
Related Issues (20)
- Error checking equality of `List(Struct(Enum)))` HOT 1
- Implement rolling functions for dtypes Int16, Int8, Boolean
- Regression in when/then/otherwise performance 0.20.15 -> 0.20.16 HOT 1
- Cannot drop a column in UDF when using `.pipe` HOT 1
- Document that `quantile` ignores `nan` values
- Support NumPy 2.0 HOT 2
- Join on multiple keys with Lazy DataFrames panics HOT 2
- DataFrame constructor fails for Uint64 arrays and lists with large values HOT 2
- Panic when sorting DataFrame by Null column HOT 1
- Cannot sort by multiple columns including Decimal column
- Stream processing support (in the style of flink/risingwave/arroyo/etc.) HOT 1
- Scan csv.gz tables HOT 1
- Create `pl.lit` from a Python `set` object? HOT 2
- Unexpected result when melting categorical columns
- Expose query execution metrics HOT 2
- Implement coverage mark tests for critical performance paths
- Cannot import name 'async_sessionmaker' from 'sqlalchemy.ext.asyncio' in 1.0.0a1 HOT 1
- `pl.scan_ipc(…)` fails when followed by `.head(0)` HOT 3
- `join` on a `literal` causes segfault when either frame has 0 rows.
- Filter doesn't return correct rows HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polars.