What is the purpose of the single underscore “_” variable in Python?

_ has 3 main conventional uses in Python: To hold the result of the last executed expression in an interactive interpreter session (see docs). This precedent was set by the standard CPython interpreter, and other interpreters have followed suit For translation lookup in i18n (see the gettext documentation for example), as in code like raise … Read more

Plotting a python dict in order of key values

I have a python dictionary that looks like this: They keys are type int, the values are type float64. Unfortunately, when I try to plot this with lines, matplotlib connects the wrong points (plot attached). How can I make it connect lines in order of the key values?