Dictionaries are similar to lists in Python but can have a non-numeric "key" as the index to the item in the dictionary. This creates a "key-value pair".
Note: If you use arrays (or vectors) and lists in other languages, you may want to know that a "list" in Python is implemented as what would be called an "array" or a "vector" in other languages. A "dictionary" in Python is actually implemented as what would be called a "list" in other languages.
If you are working with very large datasets, you'll want to use a list rather than a dictionary in Python. Dictionaries take considerably more memory and longer to get to a single entry than a list.
© Copyright 2018 HSU - All rights reserved.