- Регистрация
- 1 Мар 2015
- Сообщения
- 1,481
- Баллы
- 155
Introduction
Our hero today is a new java library called Fahmatrix.
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.
you can find it on
Step 1 (installation)
// select rows by position
DataFrame result = df.getRowsByPosition(new int[]{1,2,3,4,5,10,11,12,13,14,15});
// select columns by name
result = result.getColumnsByLabel(new String[]{"name","address","city"});
now you have only the needed data.
Step 4 (view data in console)
just call print()
result.print();
Final Thoughts
Fahmatrix is a new java library to make data operations easy. i hope it continues development as we want.
Our hero today is a new java library called Fahmatrix.
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.
you can find it on
Step 1 (installation)
- Goto and download the jar file.
- I use Eclipse.
- Add jar file to ./libs folder.
- Right click on project from Eclipse IDE.
- choose Java Build Path.
- Add Extrenal Java File.
- Choose the file ./libs/fahmatrix-vxxx.jar
- create class SimpleCSV.java
- add the following code.
replace path//to//data.csv with your actual data file path
import com.fahmatrix.DataFrame;
import com.fahmatrix.Series;
public class SimpleCSV {
public static void main(String[] args) {
DataFrame df = new DataFrame();
df.readCSV("path//to//data.csv");
}
}
// select rows by position
DataFrame result = df.getRowsByPosition(new int[]{1,2,3,4,5,10,11,12,13,14,15});
// select columns by name
result = result.getColumnsByLabel(new String[]{"name","address","city"});
now you have only the needed data.
Step 4 (view data in console)
just call print()
result.print();
Final Thoughts
Fahmatrix is a new java library to make data operations easy. i hope it continues development as we want.