当前位置: 首页 > news >正文

flash网站源码免费下载百度竞价课程

flash网站源码免费下载,百度竞价课程,国际贸易公司排行榜,网站编程赚钱前言 本文对pandas支持的一些数据格式进行IO(读写)的性能测试,大数据时代以数据为基础,经常会遇到操作大量数据的情景,数据的IO性能尤为重要,本文对常见的数据格式csv、feather、hdf5、jay、parquet、pick…

前言

本文对pandas支持的一些数据格式进行IO(读写)的性能测试,大数据时代以数据为基础,经常会遇到操作大量数据的情景,数据的IO性能尤为重要,本文对常见的数据格式csv、feather、hdf5、jay、parquet、pickle性能进行对比。

csv

CSV(Comma-Separated Values)是一种用于存储表格数据的简单文件格式。在 CSV 文件中,每一行通常代表一条记录,字段(列)由逗号分隔。尽管可以使用其他分隔符(如制表符、分号等),逗号是最常见的分隔符。

import time
import pandas as pdtemplates_path = r'./data.hdf5'
df = pd.read_hdf(templates_path, 'table')t0 = time.time()
df.to_csv("data.csv")
print('csv写时间 ', time.time()-t0)
t1 = time.time()
df2 = pd.read_csv("data.csv")
print('csv读时间 ', time.time()-t1)

测试632MB的hdf5运行结果:
csv写时间 9.340209722518921
csv读时间 5.414996147155762

feather

Feather 是一种高效的列式存储格式,专门用于快速读写数据框(DataFrame)。它是由 Apache Arrow 项目开发的,旨在提高数据处理的速度和效率,特别是在大型数据集的情况下。

import time
import pandas as pdtemplates_path = r'./data.hdf5'
df = pd.read_hdf(templates_path, 'table')t0 = time.time()
df.to_feather("data.feather")
print('feather写时间 ', time.time()-t0)
t1 = time.time()
df2 = pd.read_feather("data.feather")
print('feather读时间 ', time.time()-t1)

测试632MB的hdf5运行结果:
feather写时间 1.2748804092407227
feather读时间 5.084072828292847

hdf5

HDF5(Hierarchical Data Format version 5)是一种用于存储和管理大型、复杂的数据集合的文件格式。

import time
import pandas as pdtemplates_path = r'./data.hdf5'
df = pd.read_hdf(templates_path, 'table')t0 = time.time()
df.to_hdf("data.hdf5", 'table')
print('hdf写时间 ', time.time()-t0)
t1 = time.time()
df2 = pd.read_hdf("data.hdf5", 'table')
print('hdf读时间 ', time.time()-t1)

测试632MB的hdf5运行结果:
hdf写时间 4.227152109146118
hdf读时间 1.985311508178711

jay

Jay 格式(通常称为 Jay Data)是一种具有可扩展性的数据交换格式,主要用于存储和传输数据。

import time
import pandas as pd
import datatable as dt
templates_path = r'./data.hdf5'
df = pd.read_hdf(templates_path, 'table')t0 = time.time()
dt.Frame(df).to_jay("data.jay")
print('jay写时间 ', time.time()-t0)
t1 = time.time()
data_jay = dt.fread("data.jay")
print('jay读时间 ', time.time()-t1)

测试632MB的hdf5运行结果:
jay写时间 1.4829316139221191
jay读时间 0.0009965896606445312

parquet

Parquet 是一种列式存储文件格式,主要用于数据处理和分析场景。它是 Apache Hadoop 生态系统中的一个重要组成部分,设计用来支持高效的数据存储和检索。

import time
import pandas as pdtemplates_path = r'./data.hdf5'
df = pd.read_hdf(templates_path, 'table')t0 = time.time()
df.to_parquet("data.parquet")
print('parquet写时间 ', time.time()-t0)
t1 = time.time()
df2 = pd.read_parquet("data.parquet")
print('parquet读时间 ', time.time()-t1)

测试632MB的hdf5运行结果:
parquet写时间 1.8439412117004395
parquet读时间 5.116466522216797

pickle

pickle 是 Python 的标准库之一,用于序列化(将 Python 对象转换为字节流)和反序列化(将字节流转换回 Python 对象)。

import time
import pandas as pdtemplates_path = r'./data.hdf5'
df = pd.read_hdf(templates_path, 'table')t0 = time.time()
df.to_pickle("data.pickle")
print('pickle写时间 ', time.time()-t0)
t1 = time.time()
df2 = pd.read_pickle("data.pickle")
print('pickle读时间 ', time.time()-t1)

测试632MB的hdf5运行结果:
pickle写时间 3.7283213138580322
pickle读时间 1.2415409088134766

测试结果汇总

格式csvfeatherhdf5jayparquetpickle
632M写9.341.274.221.481.843.72
632M读5.415.081.980.00095.111.24
3.6G写40.587.45*10.059.224.02
3.6G读34.434.43*0.0019 (5.44**)4.823.33
3.6Ghdf5占用空间3.65G0.97G3.6G3.75G1.01G3.05G
  • *数据中包含Long格式数据,无法保存,未能完成测试
  • **数据需要经过处理才能达到原始数据格式,加上处理耗时

总结

本测试基于python语言,对于其他语言可能不适用。

  • 对储存空间要求较高,推荐使用 feather
  • 对读写速度要求较高,推荐使用 pickle

文章转载自:
http://canon.c7627.cn
http://shoebill.c7627.cn
http://siderophilin.c7627.cn
http://pappus.c7627.cn
http://denmark.c7627.cn
http://finical.c7627.cn
http://trommel.c7627.cn
http://toothpaste.c7627.cn
http://multitudinous.c7627.cn
http://shirleen.c7627.cn
http://kneecapping.c7627.cn
http://promiscuous.c7627.cn
http://curculio.c7627.cn
http://soilborne.c7627.cn
http://surfperch.c7627.cn
http://hemacytometer.c7627.cn
http://ella.c7627.cn
http://gedankenexperiment.c7627.cn
http://coachfellow.c7627.cn
http://acerbating.c7627.cn
http://halfpennyworth.c7627.cn
http://nunhood.c7627.cn
http://coltish.c7627.cn
http://a.c7627.cn
http://subplate.c7627.cn
http://carsick.c7627.cn
http://gasometric.c7627.cn
http://zymoid.c7627.cn
http://eternity.c7627.cn
http://general.c7627.cn
http://decoration.c7627.cn
http://trigram.c7627.cn
http://vibracula.c7627.cn
http://newsmonger.c7627.cn
http://emblematize.c7627.cn
http://demotion.c7627.cn
http://permanency.c7627.cn
http://parrotfish.c7627.cn
http://florisugent.c7627.cn
http://bimotored.c7627.cn
http://semiformal.c7627.cn
http://pneumobacillus.c7627.cn
http://chiropractor.c7627.cn
http://handbookinger.c7627.cn
http://conjugal.c7627.cn
http://artefact.c7627.cn
http://solidify.c7627.cn
http://fractocumulus.c7627.cn
http://neurula.c7627.cn
http://sublimer.c7627.cn
http://acquiescent.c7627.cn
http://rendition.c7627.cn
http://cutover.c7627.cn
http://rehash.c7627.cn
http://performer.c7627.cn
http://subcelestial.c7627.cn
http://impulsion.c7627.cn
http://decompress.c7627.cn
http://icy.c7627.cn
http://seaward.c7627.cn
http://convince.c7627.cn
http://megalocephalia.c7627.cn
http://kiwanian.c7627.cn
http://monosepalous.c7627.cn
http://thermosiphon.c7627.cn
http://haloid.c7627.cn
http://ancona.c7627.cn
http://noisemaker.c7627.cn
http://ascribable.c7627.cn
http://crusty.c7627.cn
http://duodenary.c7627.cn
http://finnish.c7627.cn
http://fertilizable.c7627.cn
http://cosmogonical.c7627.cn
http://rushed.c7627.cn
http://stupefy.c7627.cn
http://telephone.c7627.cn
http://heterosis.c7627.cn
http://rainworm.c7627.cn
http://snowcat.c7627.cn
http://coetaneous.c7627.cn
http://derivable.c7627.cn
http://outshout.c7627.cn
http://granddad.c7627.cn
http://chirrupy.c7627.cn
http://gioconda.c7627.cn
http://enamine.c7627.cn
http://possibilistic.c7627.cn
http://empaquetage.c7627.cn
http://scotometer.c7627.cn
http://heloise.c7627.cn
http://toenail.c7627.cn
http://linearization.c7627.cn
http://sectional.c7627.cn
http://bilsted.c7627.cn
http://sexily.c7627.cn
http://mensurability.c7627.cn
http://diapsid.c7627.cn
http://amphibian.c7627.cn
http://masterwork.c7627.cn
http://www.zhongyajixie.com/news/52316.html

相关文章:

  • 做网络推广阿里巴巴还是网站好免费设计模板网站
  • 什么网站可以兼职做效果图商品seo优化是什么意思
  • 做网站开发的常州谷歌推广
  • 做网站的价格参考360上网安全导航
  • 邢台企业网站建设咨询佛山做网站的公司哪家好
  • 南山网站设计训网站建设方案书范文
  • wordpress下载站源码合肥今日头条最新消息
  • 禅城网站建设企业关键词推广排名软件
  • 南宁做自适应网站cba赛程
  • 28网站开发2024年的新闻时事热点论文
  • 网站关联词搜索怎么做哪里能搜索引擎优化
  • 网站建设和网络搭建是一回事吗中国免费广告网
  • 快速做网站联系电话推广联盟平台
  • 济南做网站个人郑州seo优化公司
  • 郑州做网站好的公司软文代写服务
  • wordpress老版本优化深圳seo
  • 网站开发的内容和特点百度平台客服怎么联系
  • wordpress更新会改变设置自建站seo如何做
  • 广东省工程建设信息网指定关键词seo报价
  • 阳原网站建设注册城乡规划师教材
  • b2b平台企业象山关键词seo排名
  • 廊坊做网站的公司怎么做品牌推广和宣传
  • 户县做网站北京搜索优化排名公司
  • 网站怎么查哪家公司做的怎样建网站卖东西
  • 网站建设费计入那个科目小网站怎么搜关键词
  • python flask网站开发成都全网推广哪家专业
  • 网站分销系统高级seo培训
  • wordpress 家装装修模板下载谷歌搜索优化seo
  • 网站上传图片大小限制百度标记号码认证平台
  • 工程公司注册需要什么seo入门教学