使用Arrow管理数据

在之前的数据挖掘:是时候更新一下TCGA的数据了推文中,保存TCGA的数据就是使用Arrow格式,因为占空间小,读写速度快,多语言支持(我主要使用的3种语言都支持)

Format

https://arrow.apache.org

Apache Arrow defines a language-independent columnar memory format for flat and hierarchical data, organized for efficient analytic operations on modern hardware like CPUs and GPUs. The Arrow memory format also supports zero-copy reads for lightning-fast data access without serialization overhead.

Language Supported

Arrow's libraries implement the format and provide building blocks for a range of use cases, including high performance analytics. Many popular projects use Arrow to ship columnar data efficiently or as the basis for analytic engines.

Libraries are available for C, C++, C#, Go, Java, JavaScript, Julia, MATLAB, Python, R, Ruby, and Rust.

Ecosystem

Apache Arrow is software created by and for the developer community. We are dedicated to open, kind communication and consensus decisionmaking. Our committers come from a range of organizations and backgrounds, and we welcome all to participate with us.

R

install.packages("arrow")

library(arrow)

write iris to iris.arrow and compressed by zstd

arrow::write_ipc_file(iris,'iris.arrow', compression = "zstd",compression_level=1)

read iris.arrow as DataFrame

iris=arrow::read_ipc_file('iris.arrow')

python

conda install -y pandas pyarrow

import pandas as pd

read iris.arrow as DataFrame

iris=pd.read_feather('iris.arrow')

write iris to iris.arrow and compressed by zstd

iris.to_feather('iris.arrow',compression='zstd', compression_level=1)

Julia

using Pkg

Pkg.add(["Arrow","DataFrames"])

using Arrow, DataFrames

read iris.arrow as DataFrame

iris = Arrow.Table("iris.arrow") |> DataFrame

write iris to iris.arrow, using 8 threads and compressed by zstd

Arrow.write("iris.arrow",iris,compress=:zstd,ntasks=8)

相关推荐
天宇_任17 分钟前
Mysql数据库迁移到GaussDB注意事项
数据库·mysql·gaussdb
xiep14383335103 小时前
Ubuntu 安装带证书的 etcd 集群
数据库·etcd
Java小白程序员4 小时前
Spring Framework:Java 开发的基石与 Spring 生态的起点
java·数据库·spring
老虎06274 小时前
数据库基础—SQL语句总结及在开发时
数据库·sql·oracle
爱掘金的土拨鼠6 小时前
国产化dm数据库锁表解锁
数据库
庖丁解java6 小时前
N个Utils
数据库
Mr. zhihao7 小时前
SQL LEFT JOIN 与 WHERE 条件的隐藏坑
数据库·sql
2301_793086877 小时前
Redis 04 Reactor
数据库·redis·缓存
Sais_Z7 小时前
ClickHouse的学习与了解
数据库·clickhouse
代码的余温7 小时前
MySQL性能优化:10个关键参数调整指南
数据库·mysql·性能优化