If I create a Python dict which uses integers as keys, can I safely assume that iterating over the dict will retrieve items in order according to key value?
i.e. wil
No, Python dictionaries do not have inherent ordering, regardless of the key values. If you need ordering, stick to arrays or lists, or better yet - check out pandas
, which will allow a similar ability to dictionaries to call by key value, as well as many other powerful features (http://pandas.pydata.org/pandas-docs/stable/10min.html).