Back to browse
GitHub Repository

Drop-in pandas replacement backed by PyTorch custom C++ ops — enables torch.jit.script compilation and pure C++ inference

4 starsPython

Xpandas – running Pandas-style computation directly in pure C++

by xqli·Mar 2, 2026·6 points·0 comments

AI Analysis

●●●BangerWizardryBig BrainZero to One

Compiles pandas logic to TorchScript, then runs C++-only inference—eliminates Python runtime bottleneck for quant workflows.

Strengths
  • Novel deployment pattern: write pandas in Python, freeze to .pt, ship to bare-metal C++ with zero rewrite—GIL and latency disappear entirely.
  • 35 ops (groupby, rolling, ewm, shift, zscore, cumulative) cover 80% of quant signal engineering without reimplementing all of pandas.
  • Benchmarks show 2–163× speedup on rolling and element-wise ops; pure C++ inference removes Python interpreter overhead and GIL blocking.
Weaknesses
  • Subset of 35 ops limits adoption to specific domains (quantitative trading, online ML inference); general data science users still need pandas.
  • Immature ecosystem—no integrations, raw experimental quality, and depends on PyTorch's C++ bindings (adds deployment complexity).
Target Audience

Quantitative traders, high-frequency trading engineers, edge/embedded ML teams, low-latency inference platforms

Similar To

Polars · Modin · Datafusion

Post Description

Hi HN,

I’ve been exploring whether pandas can be used as a computation description, rather than a runtime.

The idea is to write data logic in pandas / NumPy, then freeze that logic into a static compute graph and execute it in pure C++, without embedding Python.

This is not about reimplementing pandas or speeding up Python. It’s about situations where pandas-style logic is useful, but Python itself becomes a liability (latency, embedding, deployment).

The project is still small and experimental, but it already works for a restricted subset of pandas-like operations and runs deterministically in C++.

Repo: https://github.com/CVPaul/xpandas

I’d love feedback on whether this direction makes sense, and where people think it would break down.

Similar Projects

Developer Tools●●Solid

Nimic – write pure Python and compile AOT to native binaries via Nim

Python-to-Nim transpiler with ctypes-backed types when Cython and Numba already exist.

Big BrainNiche Gem
dima-quant
505d ago