I have two dictionaries with same keys but different values and I want to concatenate the values into a single dictionary like this:
INPUT
dict_1 = {0: 0.001469768840129216, 1: 0.004734336468720571, 2: -0.005826401939721929, 3: -0.02846783060538032, 4: 0.008589455025104595, 5: -0.0005503362650310596}
dict_2 = {0: 0.355343768840129216, 1: 0.678679878468720571, 2: -0.045776401939778954, 3: -0.67476463060538032, 4: 0.646746674675123533, 5: -0.3562346762650313643}
I want the output to look something like this
OUTPUT
dict_3 = {0: array([0.001469768840129216, 0.355343768840129216]), 1: array([0.004734336468720571, 0.678679878468720571]), 2: array([-0.005826401939721929, -0.045776401939778954]), 3: array([-0.02846783060538032, -0.67476463060538032]), 4: array([0.008589455025104595, 0.646746674675123533]), 5: array([-0.0005503362650310596, -0.3562346762650313643])}
Hi,
Please edit your post and explain how this is related to bioinformatics and what you've tried by yourself to solve the problem. If it is not related to bioinformatics, please search/ask Stack Overflow.
Please use the formatting bar (especially the
code
option) to present your post better. You can use backticks for inline code (`text` becomestext
), or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.