【发布时间】:2016-10-21 17:36:41
【问题描述】:
我加载了一个 csv 文件并使用标题来指定每列的名称。
# Load the Data
data = np.genfromtxt('dat_h.csv',
delimiter=',',
names=True)
这太棒了,因为我可以通过名称访问列。比如……
DATES = data['Dates']
Temperature = data['Temp']
假设我有一个与这些测量值相匹配的压力观测向量。我可以在数据结构中附加一个包含我的压力变量的新字段吗?
我想做这样的事情......
data.append('Pressure',pressure_vector)
# and then be able to access that field like I do the other fields
data['Pressure']
【问题讨论】:
标签: python numpy genfromtxt