I have a dict as dict = {'a': array[5, 5]}
, here array[5, 5]
means it is read from a data file as a form of an array by 5X5. And I just want to use the first column of the value like dict['a': array[:, 1]]
, how can I make it? Thanks! Part of my code is:
coord['c%i' % i] = np.loadtxt('0cracknodecoord.txt', usecols=(0, 1))
print (coord['c1': array[:, [1]]])
The print (coord['c1': array[:, [1]]])
didn't work.
I'm not sure, but I think you want:
dict['a'][:,1]
You were pretty close already!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.