首页 > 其他分享 >使用Arrow管理数据

使用Arrow管理数据

时间:2024-05-26 21:32:08浏览次数:13  
标签:iris Arrow 管理 read zstd write 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)

标签:iris,Arrow,管理,read,zstd,write,arrow,数据
From: https://blog.csdn.net/2401_84540063/article/details/139128785

相关文章

  • 山东大学软件学院数据库实验1-9(全部)
    目录前言实验代码实验一1-11-2 1-3 1-4 1-5 1-6 实验二2-1 2-22-3 2-42-5 2-62-72-82-92-10实验三 3-13-23-33-43-53-63-73-83-93-10实验四 4-14-24-34-44-54-64-74-84-94-10实验五 5-15-25-35-45-55-65-75-8......
  • mysql数据库监控跟踪方案
    方案一canal+kafka  QuickStart·alibaba/canalWiki(github.com)1.自定义处理程序,完全自定义开发,适配各种需求2.只支持增删改操作监控方案二通过软件NeorProfileSQLhttp://www.profilesql.com/files/download/sqlprofiler-4.1.1.exe1.可以监控所有执行的sql语......
  • 2024电工杯数学建模B题Python代码+结果表数据教学
    2024电工杯B题保姆级分析完整思路+代码+数据教学B题题目:大学生平衡膳食食谱的优化设计及评价 以下仅展示部分,完整版看文末的文章importpandasaspddf1=pd.read_excel('附件1:1名男大学生的一日食谱.xlsx')df1#获取所有工作表名称excel_file=pd.ExcelFile('附件1......
  • 在Ubuntu中部署MongoDB数据库
    提示:为了方便,接下来的操作都在shell中进行(需提前建立ssh连接),当然也可以在虚拟机中进行。1.导入MongoDB的公钥首先导入MongoDB的公钥,以便后续下载和安装MongoDB输入如下代码wget-qO-https://www.mongodb.org/static/pgp/server-6.0.asc|sudoapt-keyadd-2.创建M......
  • 二叉树遍历算法与堆数据结构详解(C语言)
    目录树的概念及结构二叉树的概念及结构概念二叉树的性质满二叉树和完全二叉树满二叉树完全二叉树深度的计算二叉树顺序结构及实现顺序存储堆的概念数组建堆向下调整堆的实现完整代码Heap.hHeap.cTest.c堆的初始化(实现小堆为例)插入数据删除堆顶的数据 ......
  • 【高阶数据结构】红黑树
    1.红黑树的概念2.红黑树的性质只要满足前四点规则,就能保证最长路径<=最短路径*2。由红黑树的性质可以推出:1.最短路径全是黑色结点2.最长路径一定是一红一黑相间的。3.红黑树插入结点的规则首先我们每次插入结点时都需要插入红色结点。因为插入红色结点可能会违背......
  • 微服务实践k8s&dapr开发部署实验(2)状态管理
    新建webapi项目建项目时取消https支持,勾选docker支持,Program.cs中注释下面语句,这样部署后才能访问Swagger//ConfiguretheHTTPrequestpipeline.//if(app.Environment.IsDevelopment()){app.UseSwagger();app.UseSwaggerUI();}添加Dapr.Client与Dapr.A......
  • 【嵌入式DIY实例】-OLED显示电容式土壤湿度传感器数据
    OLED显示电容式土壤湿度传感器数据本文将演示如何在OLED中显示土壤湿度传感器数据以及不同的数据值范围,使用不同的表情图片显示。本次实例主要通过如下步骤来完成:土壤湿度传感器数据采集OLEDc驱动采集数据处理及OLED显示在前面的文章中,对OLED及其驱动做了详细的介......
  • 【高阶数据结构】 B树 -- 详解
    一、常见的搜索结构适合做内查找:以上结构适合用于数据量相对不是很大,能够一次性存放在内存中,进行数据查找的场景。如果数据量很大,比如有100G数据,无法一次放进内存中,那就只能放在磁盘上了。如果放在磁盘上,有需要搜索某些数据,那么如果处理呢?那么我们可以考虑将存放关键字......
  • YOLOv10 | 手把手教你利用yolov10训练自己数据集(含环境搭建 + 参数解析 + 数据集查找
    一、前言本文内含YOLOv10网络结构图+各个创新模块手撕结构图+训练教程+推理教程+  参数解析+环境搭建+数据集获取等一些有关YOLOv10的内容!目录一、前言 二、整体网络结构图 三、空间-通道分离下采样3.1SCDown介绍 3.2C2fUIB介绍3.3PSA介绍4.4更......