In python2. X, dict. Keys() returns a list, and in python3. X, dict. Keys() returns a dict_ The keys object acts more like a set than a list, so it does not support indexing
Solution: list (dict. Keys()) [index]
Similar Posts:
- [Solved] Python Error: TypeError: ‘dict_keys’ object does not support indexing
- [How to Solve] ‘dict’ object has no attribute ‘has_key’
- PaddlePaddle Error: ‘map’ object is not subscriptable
- Flask Accessing an interface that returns a dictionary error: The view function did not return a valid response. The return type must be a string, tuple, Response instance, or WSGI callable, but it was a dict.
- Django: How to Convert Models object to JSON
- How to Solve Python TypeError: ‘list’ object is not callable
- Python3: list dict set [UNK]unhashable type
- [Solved] TypeError: string indices must be integers, not str
- [Solved] Python error: attributeerror: type object ‘STR’ has no attribute ‘_name_’ (machine learning practice treeplotter code)
- How to Solve SQL fulltext error