I have to fetch values from a dictionary vertically.
mydict={'a':[1,2],'b':[3,4],'c':[0,9]}
keys=list(mydict.keys())
values=list(mydict.values())
Simple Output
['a', 'b', 'c'] #keys
[[1, 2], [3, 4], [0, 9]] #values
Desired output:
def fetch_value(mydict):
... #do something
return v1,v2
##output
v1=[1,3,0]
v2=[2,4,9]
I don't want to use any for loop here as it took time and I have a very large dataset.Please suggest any faster way to do that.
question from:
https://stackoverflow.com/questions/66059727/access-multiple-values-from-dictionary-vertically 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…