Improve map
This commit is contained in:
parent
ced6b16140
commit
a2e4c29839
10 changed files with 285 additions and 111 deletions
|
|
@ -28,7 +28,8 @@ def process_postcodes() -> pl.LazyFrame:
|
|||
df = df.with_columns(
|
||||
pl.struct(["lat", "long"])
|
||||
.map_elements(
|
||||
lambda x: lat_long_to_h3(x["lat"], x["long"], res),
|
||||
# Capture res by value using default argument to avoid closure bug
|
||||
lambda x, res=res: lat_long_to_h3(x["lat"], x["long"], res),
|
||||
return_dtype=pl.Utf8,
|
||||
)
|
||||
.alias(col_name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue