No description
Find a file
2025-11-11 13:58:55 +00:00
src use iterator 2025-11-11 13:58:55 +00:00
tests amend 2025-11-02 22:09:23 +00:00
.gitignore ignore 2025-07-22 21:43:48 +01:00
LICENSE license, readme and primary test 2025-07-22 22:17:52 +01:00
razor.nimble tests 2025-11-02 22:03:27 +00:00
README.md fix describe function 2025-07-22 22:26:37 +01:00

Razor

Razor is a feature-rich, high-performance dataframe library, inspired by Pythons pandas but leveraging Nims 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.