我是python的新手,所以這可能聽起來很基本。我已經使用csv2rec導入了一個csv文件。第一行有標題。我想將標題更改爲'x','y','z'。這樣做的最好方法是什麼?我可以重命名字段在一個numpy記錄陣列
>>> import matplotlib
>>> import matplotlib.mlab as mlab
>>> r= mlab.csv2rec('HeightWeight.csv', delimiter= ',')
>>> names= r.dtype.names
>>> for i in names:
print i
index
heightinches
weightpounds
+1應用相同的重命名操作 - 甚至更好。 – DSM