我有兩個 numpy.ndarray[[' THE OLD TESTAMENT '][' SEAN SONG '][' CITY WALK ']]和[[' This is the name of an Old Testament '] [' Hello this is great '][' Wait the way you are doing ']]我想將這些 ndarray 轉(zhuǎn)換為字典。 {"THE OLD TESTAMENT": "This is the name of an Old Testament","SEAN SONG": "Hello this is great","CITY WALK": Wait the way you are doing }我正在使用下面寫的代碼keys = df.as_matrix()print (keys)values = df1.as_matrix()print (values)new_dict = dict(izip(keys, values))
添加回答
舉報
0/150
提交
取消