我有1个数据框“ csv”,如下所示
movieId | title| genres|
+-------+--------------------+--------------------+
| 1| Toy Story (1995)|Adventure|Animati...|
| 2| Jumanji (1995)|Adventure|Childre...|
COMMAND1:print("PRINT",csvData.dtypes)
OUTPUT1:('PRINT', [('movieId', 'int'), ('title', 'string'), ('genres', 'string')])
命令2:print ("SAMPLE dictionary**",dict(csvData.dtypes))
OUTPUT2:'SAMPLE dictionary**', {'genres': 'string', 'movieId': 'int', 'title': 'string'}
比较两个输出后,我们可以看到dict()函数更改了元素的顺序,我该如何避免呢?