Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

why cannot recalculate?

html("

From Dictionary to Matrix (1)

") @interact def newtarph( D=input_box(default={0: {1: 3}, 1: {0: 2, 4: 2, 5: 2}, 2: {0: 3, 1: 4}}, label='Dictionary')): E=[] for u in D.keys(): for i in range(len(D.values()[u])):
E.append([u, D.values()[u].keys()[i], D.values()[u].values()[i]]) print matrix(E)

click to hide/show revision 2
No.2 Revision

why cannot recalculate?

html("

html("<h1> From Dictionary to Matrix (1)

")
(1)</h1>") @interact def newtarph( D=input_box(default={0: {1: 3}, 1: {0: 2, 4: 2, 5: 2}, 2: {0: 3, 1: 4}}, label='Dictionary')): E=[] for u in D.keys(): for i in range(len(D.values()[u])):
E.append([u, D.values()[u].keys()[i], D.values()[u].values()[i]]) print matrix(E)

matrix(E)

why cannot recalculate?

html("<h1> 

These code work fine

html("

From Dictionary to Matrix (1)</h1>") (1)

")
@interact def newtarph( D=input_box(default={0: {1: 3}, D=input_box(default={0:{1:3}, 1: {0: 2, 4: 2, 5: 2}, 2: {0: 3, 1: 4}}, label='Dictionary')): E=[] for u in D.keys(): for i in range(len(D.values()[u])):
E.append([u, D.values()[u].keys()[i], D.values()[u].values()[i]]) print matrix(E)
matrix(E)

These other code d'ont work:

html("

From Dictionary to Matrix (1)

") @interact def newtarph( D=input_box(default={1: {0: 2, 4: 2, 5: 2}, 2: {0: 3, 1: 4}}, label='Dictionary')): E=[] for u in D.keys(): for i in range(len(D.values()[u])):
E.append([u, D.values()[u].keys()[i], D.values()[u].values()[i]]) print matrix(E)

click to hide/show revision 4
No.4 Revision

why cannot recalculate?

These code work fine

html("

html("<h1> From Dictionary to Matrix (1)

")
(1)</h1>") @interact def newtarph( D=input_box(default={0:{1:3}, 1: {0: 2, 4: 2, 5: 2}, 2: {0: 3, 1: 4}}, label='Dictionary')): E=[] for u in D.keys(): for i in range(len(D.values()[u])):
E.append([u, D.values()[u].keys()[i], D.values()[u].values()[i]]) print matrix(E)

matrix(E)

These other code d'ont work:

html("

html("<h1> From Dictionary to Matrix (1)

")
(1)</h1>") @interact def newtarph( D=input_box(default={1: {0: 2, 4: 2, 5: 2}, 2: {0: 3, 1: 4}}, label='Dictionary')): E=[] for u in D.keys(): for i in range(len(D.values()[u])):
E.append([u, D.values()[u].keys()[i], D.values()[u].values()[i]]) print matrix(E)

matrix(E)