golars

golars / polars API surface

Map between polars' Python API and golars' Go surface.

Last synced: 2026-04-24.

Authoritative map between polars' Python API (pl.*) and golars' Go surface. Status column values:

  • done shipped and covered by tests
  • partial shipped for a common subset; documented gaps
  • todo not yet

The package-level facade at the repo root (import "github.com/Gaurav-Gosain/golars") re-exports the most commonly needed symbols so casual users do not need to know which sub-package each name lives in.

Top-level functions (pl.* / golars.*)

polarsgolarsStatusNotes
pl.DataFrame({...})golars.FromMap(...)doneslice-of-go map constructor
pl.from_arrow(tbl)dataframe.FromArrowTable(tbl)done
pl.concat([...])dataframe.Concat(...)donevertical
pl.col(name)golars.Col(name)donealso typed: expr.C[T], expr.Int, expr.Float, expr.Str, expr.Bool, expr.Int32, expr.Float32
pl.lit(v)golars.Lit(v)doneplus LitInt64/LitFloat64/LitString/LitBool; generic expr.LitOf[T]
pl.when(p).then(a).otherwise(b)golars.When(p).Then(a).Otherwise(b)doneexecutor uses compute.Where with dtype promotion
pl.sum(col), mean, min, max, count, first, last, median, std, vargolars.Sum(col) and friendsdonecol-scoped agg sugar
pl.read_csvgolars.ReadCSVdone
pl.read_parquetgolars.ReadParquetdone
pl.read_ipc / read_arrowgolars.ReadIPCdone
pl.read_json / read_ndjsongolars.ReadJSON / golars.ReadNDJSONdone
pl.read_databaseio/sql.ReadSQLdone
pl.read_clipboardio/clipboard.ReaddoneCSV transport
pl.read_avrotododefer
pl.read_exceltodoneeds xuri/excelize dep
pl.read_delta / read_icebergtodoRFC required
pl.scan_csvio/csv.ScandoneLazyFrame source
pl.scan_parquetio/parquet.Scandone
pl.scan_ipcio/ipc.Scandone
pl.scan_ndjsonio/json.ScanNDJSONdone

DataFrame methods

polarsgolarsStatus
df.shapedf.Shape()done
df.height / .widthdf.Height() / .Width()done
df.columnsdf.ColumnNames()done
df.dtypesdf.DTypes()done
df.schemadf.Schema()done
df.is_emptydf.IsEmpty()done
df.estimated_sizedf.EstimatedSize()done
df.equalsdf.Equals(other)done
df.glimpsedf.Glimpse(n)done
df.head / .tail / .limitdf.Head / .Tail / .Limitdone
df.slicedf.Slice(offset, length)done
df.select(exprs)df.Select(names...) / golars.SelectExpr(ctx, df, exprs...)done
df.with_columns(exprs)df.WithColumns(series...) / golars.WithColumnsExpr(ctx, df, exprs...)done
df.with_columndf.WithColumn(series)done
df.renamedf.Rename(old, new)done
df.dropdf.Drop(names...)done
df.filter(mask)df.Filter(ctx, mask)done
df.sort(by)df.Sort / .SortBydone
df.reversedf.Reverse(ctx)done
df.sample(n)df.Sample(ctx, n, replacement, seed)done
df.shuffledf.Shuffle(ctx, seed)done
df.clonedf.Clone()done
df.cleardf.Clear()done
df.group_by(...).agg(...)df.GroupBy(...).Agg(ctx, [expr...])done
df.join(other, on, how)df.Join(ctx, right, on, how)done
df.vstack / .hstackdf.VStack(other) / df.HStack(other)done
df.concattop-level dataframe.Concat(...)done
df.describedf.Describe(ctx)done
df.null_countdf.NullCount()done
df.row(i)df.Row(i)done
df.rows()df.Rows()done
df.to_dictdf.ToMap()done
df.to_arrow / to_pandasdf.ToArrow() / df.ToArrowTable()done (n/a for pandas)
df.write_csv / write_parquet / write_ipc / write_json / write_ndjsonio/*.WriteFile(ctx, path, df, ...)done
df.gather(indices)df.Gather(ctx, indices)done
df.pivotdf.Pivot(ctx, index, on, values, PivotAgg)done
df.unpivot (melt)df.Unpivot(ctx, idVars, valueVars)done
df.transposedf.Transpose(ctx, headerCol, prefix)done (numeric/bool)
df.partition_bydf.PartitionBy(ctx, keys...)done
df.top_k / df.bottom_kdf.TopK(ctx, k, col) / df.BottomK(ctx, k, col)done
df.pipe(fn)df.Pipe(fn)done
df.corr / df.covdf.Corr(ctx) / df.Cov(ctx, ddof)done
df.explodedf.Explode(ctx, col)done
df.unnestdf.Unnest(ctx, col)done
df.upsampledf.Upsample(ctx, col, every)done

Series methods

Inspection

polarsgolarsStatus
s.dtypes.DType()done
s.names.Name()done
s.lens.Len()done
s.null_counts.NullCount()done
s.has_nullss.HasNulls()done
s.is_emptys.IsEmpty()done
s.n_chunkss.NumChunks()done
s.n_uniques.NUnique()done
s.is_sorteds.IsSorted(order)done

Math (scalar)

polarsgolarsStatus
s.abss.Abs()done
s.sqrts.Sqrt()done
s.exps.Exp()done
s.logs.Log()done
s.log2 / log10s.Log2 / .Log10done
s.sin / cos / tans.Sin / .Cos / .Tandone
s.round(d)s.Round(d)done
s.floor / ceils.Floor / .Ceildone
s.signs.Sign()done
s.clip(lo, hi)s.Clip(lo, hi)done
s.pow(exp)s.Pow(exp)done

Aggregations (scalar-returning)

polarsgolarsStatus
s.sums.Sum()done
s.means.Mean()done
s.min / maxs.Min() / .Max()done
s.medians.Median()done
s.std / vars.Std() / .Var()done
s.quantile(q)s.Quantile(q)done
s.any / alls.Any() / .All()done
s.products.Product()done

Position / argsort

polarsgolarsStatus
s.arg_min / arg_maxs.ArgMin() / .ArgMax()done
s.arg_sorts.ArgSort()done
s.top_k(k) / bottom_ks.TopK(k) / .BottomK(k)done

Transform

polarsgolarsStatus
s.head / tails.Head / .Taildone
s.slices.Slicedone
s.reverses.Reversedone
s.samples.Sampledone
s.shuffles.Shuffledone
s.sortcompute.Sort(ctx, s, opts)done
s.uniques.Unique()done
s.value_countss.ValueCounts(sort)done
s.rename / aliass.Rename(name)done
s.clones.Clone()done
s.castcompute.Cast(ctx, s, dt)done
s.rechunk / chunkss.Rechunk() / s.Chunk(i) / .Chunked()done

Null handling

polarsgolarsStatus
s.is_null / is_not_nulls.IsNull() / .IsNotNull()done
s.is_nan / is_finite / is_infinites.IsNaN() / .IsFinite() / .IsInfinite()done
s.fill_null(v)s.FillNull(v)done
s.drop_nullss.DropNulls()done

Cumulative

polarsgolarsStatus
s.cum_sums.CumSum()done
s.cum_min / cum_maxs.CumMin() / .CumMax()done
s.cum_prods.CumProd()done
s.cum_counts.CumCount()done
s.diff(periods)s.Diff(periods)done
s.shift(periods)s.Shift(periods)done
s.pct_change(periods)s.PctChange(periods)done
s.modes.Mode()done

Rolling / windowed

polarsgolarsStatus
s.rolling_sum / rolling_mean / rolling_min / rolling_max / rolling_std / rolling_varmatching methods with RollingOptionsdone
s.ewm_mean / s.ewm_var / s.ewm_stds.EWMMean(alpha) / .EWMVar(alpha) / .EWMStd(alpha)done

String namespace (s.str.*)

polarsgolarsStatus
str.len_bytes / len_chars.Str().LenBytes() / .LenChars()done
str.to_uppercase / to_lowercase.Str().Upper() / .Lower()done
str.title.Str().Title()done
str.contains.Str().Contains(sub)done
str.starts_with / ends_with.Str().StartsWith() / .EndsWith()done
str.replace / replace_all.Str().Replace() / .ReplaceAll()done
str.strip_chars.Str().Trim() / .LStrip() / .RStrip()done
str.strip_prefix / strip_suffix.Str().StripPrefix() / .StripSuffix()done
str.pad_start / pad_end / zfill.Str().PadStart() / .PadEnd() / .ZFill()done
str.reverse.Str().Reverse()done
str.slice.Str().Slice(start, len)done
str.count_matches.Str().CountMatches()done
str.concat.Str().Concat() / .Str().Prefix()done
str.extract.Str().Extract(pattern, group)done
str.contains_regex / count_matches_regex / replace_regexmatching .Str().*Regexdone
str.split_exact.Str().SplitExact(sep) (List<String>) / .Str().SplitN(sep, idx) / .Str().SplitExactNullShort(sep, idx)done

Arrow interop

polarsgolarsStatus
s.to_arrows.ToArrow() / s.ToArrowChunked()done
pl.from_arrow(arr)series.FromArrowArray / FromArrowChunkeddone
df.to_arrowdf.ToArrow() / df.ToArrowTable()done
pl.from_arrow(tbl)dataframe.FromArrowTable(tbl)done

Expr methods

polarsgolarsStatus
pl.col(x) with + - * /Col(x).Add/Sub/Mul/Div(...)done
== != < <= > >=Eq/Ne/Lt/Le/Gt/Gedone
and / or / notAnd / Or / Notdone
.alias(name).Alias(name)done
.cast(dt).Cast(dt)done
.is_null / .is_not_null.IsNull() / .IsNotNull()done
.sum .mean .min .max .count .first .last .null_countmatching methodsdone
.median .std .var .any .all .product .quantilematching methodsdone
.abs .sqrt .exp .log .log2 .log10 .sin .cos .tan .signmatching methodsdone
.round(d) .floor .ceil .clip(lo, hi) .pow(x)matching methodsdone
.fill_null(v).FillNull(v) / .FillNullExpr(e)done
.reverse .head(n) .tail(n) .slice(off, len) .shift(p)matching methodsdone
.between(lo, hi).Between(lo, hi)done
.is_in([...]).IsIn(v...)done
.over(partition).Over(keys...)done (scalar-agg fast path + generic gather-eval-scatter)
.sort.Sort(desc) (fluent via FunctionNode)done
.rank(method).Rank(method)done
.rolling_sum / .rolling_mean / ...matching .Rolling*(size, minPeriods)done
.ewm_mean / .ewm_var / .ewm_stdmatching .EWM*(alpha)done

LazyFrame methods

polarsgolarsStatus
lf.filter / .select / .with_columnslf.Filter / .Select / .WithColumnsdone
lf.with_columnlf.WithColumn(expr)done
lf.sort / .group_by / .agg / .joinmatchingdone
lf.slice / .head / .limit / .tailmatchingdone
lf.reverself.Reverse()done
lf.uniquelf.Unique()done
lf.drop / .renamematchingdone
lf.collect / .collect_unoptimizedmatchingdone
lf.explain / .show_graphlf.Explain() / lf.ExplainTree() / lf.ShowGraph()done
lf.sink_csv / sink_parquet / sink_ipc / sink_ndjsonlf.Sink(ctx, writer) plus io/*.WriteFile in writerdone

dtype

polarsgolarsStatus
Bool, Int8, Int16, Int32, Int64, UInt8 through UInt64, Float32, Float64dtype.Bool(), dtype.Int64() and friendsdone
String / Utf8dtype.String()done
Binarydtype.Binary()done
Nulldtype.Null()done
Date / Datetime(unit, tz) / Duration / Timedtype.Date / Datetime / Duration / Time + series.FromTimedone
List(inner) / Array / Struct / Fielddtype.List / FixedList / Struct + series.{ListOps, StructOps}done
Categorical / Enumtodo
Decimal / Float16 / Int128todo
Object / Unknowntodo (polars-internal)

See roadmap.md for the perf side of the same picture (throughput ratios vs polars 1.39 on the bench suite).

On this page