1,176 karma · joined August 16, 2020
import polars as pl
# 1. Base Dataset
lazy_df = pl.LazyFrame(
{
"store_id": ["S01", "S02", "S03", "S04", "S05"],
"revenue": [5000.0, 2400.0, 15000.0, 900.0, 3200.0],
"margin": [0.45, 0.30, 0.60, 0.15, 0.50],
"tx_count": [120, 45, 300, 20, 85],
"returns": [5, 12, 45, 2, 8],
}
)
# 2. Define Layer Abstractions
def get_kpi_layer() -> list[pl.Expr]:
return [
(pl.col("returns") / pl.col("tx_count")).alias("return_rate"),
(pl.col("revenue") / pl.col("tx_count")).alias("avg_order_value"),
]
def get_threshold_layer(thresholds: dict[str, list[float]]) -> list[pl.Expr]:
return [
(pl.col(col) > limit).alias(f"is_{col}above{int(limit)}")
for col, limits in thresholds.items()
for limit in limits
]
def get_interaction_layer(numeric_cols: list[str]) -> list[pl.Expr]:
return [
(pl.col(a) / (pl.col(b) + 1e-5)).alias(f"ratio_{a}per{b}")
for i, a in enumerate(numeric_cols)
for b in numeric_cols[i + 1 :]
]
def get_segmentation_layer() -> list[pl.Expr]:
return [
pl.when(pl.col("margin") > 0.4)
.then(pl.literal("High"))
.otherwise(pl.literal("Low"))
.alias("margin_profile")
]
# 3. Consolidate and Execute Single Graph Pass
thresholds = {"revenue": [1000.0, 5000.0, 10000.0], "tx_count": [50, 100, 200]}
numeric_cols = ["revenue", "margin", "tx_count", "returns"]
expr_pool = [
*get_kpi_layer(),
*get_threshold_layer(thresholds),
*get_interaction_layer(numeric_cols),
*get_segmentation_layer(),
]
final_df = lazy_df.with_columns(expr_pool).collect()I find that SQL is only easier to read with minimal abstraction, but as soon as the project gets bigger SQL becomes an unwieldy island of different that has served its purpose after we’re done with reading/writing the data.
So I can say for sure that I don't share the slop sentiment. Sure, there's some generic filler every now and then, but any non-cohesive mix, as opposed to a carefully curated album is going to have songs that naturally become "fillers".
Just now, I discovered that Spotify snuck in "The Juan Maclean - Running Back To You (2014)", which is a cover of "Brian Bennet - Solstice (1978)". Neither songs are completely unknown, but they're also not exactly Bruno Mars.
I don't know if this is pure luck or algorithmic rhythm analysis, but for me it's working.
“Stop studying Japanese. Start speaking it.”
> click here to buy our pro AI prompts
Ah, a tale almost as old as the one of the lake itself.
> A Lisp programmer does not need to …
Have you even seen R? Jupyter notebooks? The above sounds like a level of insanity beyond that.
The problem with checking things at runtime is that it’s an ever-moving target. Changed this? Now that other thing is out of sync. Changed that? Now the first thing is gone, and it came from far away so you can’t get it back in this session.
If someone gave me a report, in my hands, that said “see ‘it’” I’d also be confused.
Then, throw it all in BigQuery. Handles all the vector stuff natively.
Sprinkle an agentic bot UI thing on top to make it appear all-knowing and magical.
I assume other vendors than Google have a similar batteries-included approach you can just plug in.
> (…) the Italian artist and writer Giorgio Vasari,who used it as early as 1530, calling Gothic art a "monstrous and barbarous" "disorder".
Historical revisionism, random people :angry: :barf:
* Many businesses don't need frontier level intelligence anyway.
* It's completely stateless. If your local LLM machine catches fire? Nothing was lost. Buy another.
LLMs have enough problems distinguishing between major versions between packages, e.g. where all the imports were moved around and renamed.
You can scoff at low travel and membranes all you want, but less movement = less fatigue, so I think they’re amazing.
Never thought about the climbing angle, but I’ll chime in and say that after I started climbing I’ve definitely not experienced more fatigue.
I care how the food tastes, not that the chef has a really cool Japanese knife and is really fast at cutting onions.
It might take you from nothing to technically—a-market-fit, but from there to actually-a-market-fit?
My point is, there’s probably 1000s of companies doing the same things, following every playbook for success (do this, measure that, brand this, …), only for a single one of them to become a viral market hit, and the rest fade into obscurity.
It isn't. It falls slightly apart in the `s` column, and completely in the `t` column which contains both "chi" and "tsu". It also breaks for godan words that end in "u" which become "wa" in the negative form.
Mu, bu and nu also all obey the -nda transformation due to phonetics, and not due to how "if we just shuffle the letters around and presto! Nomu becomes nonda".
Japanese already has plenty of its own reading inconsistencies, so adding another layer on top isn't going to help you.
Finally, there's going to be so much kana in your every day life that learning conjugation in romaji is guaranteed to cripple your reading, because instead of recognizing kana (e.g. you see a billboard that says お茶を飲んだ方がいい! as you frantically try to back-translate everything into romaji, but also removing excess w's and converting nda's as you go) you've spent the first n hours on trying to "hack" the language instead of just learning it.