python结果怎么保存_如何用python增量地保存数据?

pytablesis a numpy友好的软件包,旨在将数据分页到磁盘,以便对不适合内存的数据集进行操作。

用法:# Create a data-frame description (called a table)

# each attribute of Particle below is a column.

from tables import *

class Particle(IsDescription):

name = StringCol(16) # 16-character String

idnumber = Int64Col() # Signed 64-bit integer

ADCcount = UInt16Col() # Unsigned short integer

TDCcount = UInt8Col() # unsigned byte

grid_i = Int32Col() # 32-bit integer

grid_j = Int32Col() # 32-bit integer

pressure = Float32Col() # float (single-precision)

energy = Float64Col() # double (double-precision)

# create a hdf5 file on disk to store data in

h5file = open_file("tutorial1.h5", mode="w", title="Test file")

# create a table within the file, using the Particle description class

table = h5file.create_table(group, 'readout', Particle, "Readout example")

效果:

它对于跨许多数据行的计算特别有用。

result = [row['col2'] for row in table.where(

'''(((col4 >= lim1) & (col4 < lim2)) |

((col2 > lim3) & (col2 < lim4)) &

((col1+3.1*col2+col3*col4) > lim5))''')]

1620

1620

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值