I'm using python 3.7.
I have several sets of data in the text file dict.txt
:
A = {(1, 1): 11, (2, 2): 22, (3, 3): 33, (7, 7): 77, (8, 8): 88, (9, 9): 99}
B = [[ 0 2]
[ 0 4]
[ 0 5]
[ 0 6]]
C = 0.2
D = [1 2 3 4 5]
I want to input Line1 A = {(1, 1): 11, (2, 2): 22, (3, 3): 33, (7, 7): 77, (8, 8): 88, (9, 9): 99}
as a dict
.
And I want to input B as a ndarray
.
But I don't want to input the data through the method of indexing by line number.
Is there any way I can input the data through the method of indexing by the keyword, like A, B, C, or D?