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 推出了 Fahmatrix,一个新的轻量级 Java DataFrame 库,其灵感来自 Python 的 Pandas。Fahmatrix 旨在解决 Python 数据栈(尤其是在大型数据集上)的性能限制,它在 Java 中提供了类似 Pandas 的 DataFrame 功能,并专注于速度和简洁性。其主要特性包括:无依赖运行、自动检测 header 的 CSV/TSV 导入、Series 和 DataFrame 结构、描述性统计(均值、标准差、百分位数等)以及对数值列的快速并行运算。Fahmatrix 支持 Java 17 及更高版本。创建者希望得到 Java 和数据科学社区的反馈,特别是那些需要简单、高性能的 DataFrame 工具,而无需大型机器学习库的额外负担的用户。文档和 GitHub 链接可供进一步了解。

原文

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