0
我加載了一個csv文件,並使用標題指定每列的名稱。是否可以在numpy.genfromtxt輸出中添加新字段?
# 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']