razor

Pandas equivalent

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.1.0
License GPL-3.0-only
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:27

Authors

  • Navid M

Installation

nimble install razor
choosenim install razor
git clone https://github.com/navid-m/razor

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
razor - - - - - - -

Dependencies

Package Version Optional
nim >= 2.2.4 No

Source

Repository https://github.com/navid-m/razor
Homepage https://github.com/navid-m/razor
Registry Source nimble_official

README

Razor

Razor is a feature-rich, high-performance dataframe library, inspired by Python’s pandas but leveraging Nim’s static typing and speed.

Features

  • Dataframe Creation & I/O - toCsv, readCsv
  • Data Inspection - .head(n), .describe(), .dtypes(), indexing and slicing rows and columns
  • Data Cleaning - fillNa, dropNa, dropDuplicates, replace, isin
  • Vectorized Operations - apply and applyRows for custom logic
  • Filtering & Sorting - Boolean masking - loc, mask, chained filtering
  • GroupBy & Aggregation - groupBy(...).mean(...), sum(...), etc.
  • Reshaping - melt for pivoting wide to long format
  • Time Series Utilities - dateRange, parse for date handling

Example

import razor

var df = newDataFrame()
df["name"] = newSeries(@["Alice", "Bob", "Charlie"])
df["age"] = newSeries(@[25, 30, 35])
df["score"] = newSeries(@[85.5, 92.0, 78.5])

echo df.head(2)
echo df.describe()
echo df["age"].mean()

df.toCsv("data.csv")
let df2 = readCsv("data.csv")
echo df2

Will output:

DataFrame (2x3):
             name          age        score
   0        Alice           25         85.5
   1          Bob           30         92.0

DataFrame (8x2):
              age        score
count            3            3
mean         30.0 85.33333333333333
 std          5.0 6.751543033509697
 min           25         78.5
 25%         27.5         82.0
 50%         30.0         85.5
 75%         32.5        88.75
 max           35         92.0

30.0
DataFrame (3x3):
             name          age        score
   0        Alice           25         85.5
   1          Bob           30         92.0
   2      Charlie           35         78.5

Installation

nimble install razor

Tests

All tests pass as of 2025-07.

Status

The library is production-ready for most standard data manipulation tasks.

License

GPL-3.0 only.