Show HN:Fahmatrix——一个轻量级、类似Pandas的Java DataFrame库
Show HN: Fahmatrix – A Lightweight, Pandas-Like DataFrame Library for Java

原始链接: https://github.com/moustafa-nasr/fahmatrix

Fahmatrix是一个现代化的轻量级Java库,旨在简化表格数据的处理,为JVM提供类似Pandas的体验。它允许直观地读取CSV,预览数据,过滤行和选择列。主要功能包括从CSV加载DataFrame,漂亮打印,头部/尾部视图以及聚合运算(计数、最小值、最大值、总和、平均值、中位数、标准差、百分比)。未来的增强功能包括分组、排序、透视表以及导出数据到CSV/JSON。目前,它没有任何外部依赖,并通过GitHub Releases发布,未来计划集成Maven/Gradle。Fahmatrix旨在为Java开发者提供一个简洁、表达力强的DataFrame API,以便在JVM中有效地进行表格数据操作。该库采用MIT许可证,并支持赞助以进一步发展其功能。

Mousomashakel introduced Fahmatrix, a new lightweight Java library for working with tabular data, inspired by Python's pandas. Designed for speed and simplicity on the JVM, Fahmatrix provides similar APIs for CSV manipulation, summary statistics, and slicing, but in native Java. Its features include being dependency-free, CSV/TSV import, Series/DataFrame structures, statistical functions, fast parallel operations, and Java 17+ support. The author is seeking feedback, especially from Java developers who desire a simple dataframe utility without full-scale ML libraries. Commenters noted existing libraries like Tablesaw and Kotlin DataFrame, and also the DuckDB Java API. The author clarifies that Fahmatrix is designed as a minimalistic, fully Java solution with no JNI, differentiating it from heavier, more powerful libraries like Apache Arrow. The goal is a "just enough" middle ground for environments like Android or when developers prefer Java-native, procedural code over SQL.

原文

Fahmatrix is a lightweight, modern Java library for working with tabular data, inspired by Python's Pandas and rooted in the idea of making data understanding (fahm) easy on the JVM.

🚀 Intuitive API for tabular data
📄 Easy CSV reading and previewing
🔍 Row filtering and column selection
📊 Aggregations, grouping, and sorting (coming soon)
🧩 No external dependencies (for now)


📦 Using GitHub Releases

Visit Releases and download the latest JAR file.

Include it manually in your project’s classpath or use Maven/Gradle if you're pulling from GitHub Packages (to be added in future versions).

If you're building locally:

git clone https://github.com/moustafa-nasr/fahmatrix.git
cd fahmatrix
./gradlew build

import com.fahmatrix.DataFrame;

public class Main {
    public static void main(String[] args) {
        DataFrame df = DataFrame.readCSV("data.csv");
        df.print();
    }
}

You can find compiled Java Docs over here


  • Load CSV files into DataFrame
  • Pretty-print data to console
  • View top rows with head() or bottom ones with tail()
  • Aggregations (count, min, max, sum, mean ,median, standard deviation, 25%, 50%, 70%, custom percentage)
  • Filter rows and select columns
  • GroupBy and pivot tables
  • Data export to CSV or JSON
  • Type inference and conversion

Java has lacked a clean, expressive DataFrame API — until now.

Fahmatrix brings data clarity (fahm) and structured thinking (matrix) together to give Java developers the tools they need to work with tabular data effectively, without leaving the JVM.


🙌 Support This Project

If you find Fahmatrix useful, consider sponsoring me to help support ongoing development, documentation, and future features.


MIT License. Use it freely in your projects.

联系我们 contact @ memedata.com