I have 3 numpy arrays :
a = numpy.array([['x','y']])
b = numpy.array([['x1','y1']])
c = numpy.array([['x2','y2']])
I want to create a dictionary as:
d={'x': ['x1','x2'], 'y':['y1','y2']}
How do I create such a dictionary?
If you actually want d={'x':['x1','x2'],'y':['y1','y2']}
you can go:
d = {i: [j, x] for i,j,x in zip(a,b,c)}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With