For questions about Python programming that are specific to version 2.x of the language.
I use this code to pretty print a dict into JSON: import json d = {'a': 'blah', 'b': 'foo', 'c': [1,2,3]} print …
python json dictionary python-2.x dumpIs there any clever in-built function or something that will return 1 for the min() example below? (I bet there is …
python list max python-2.x minimumI'm trying to use NumPy to check if user input is numerical. I've tried using: import numpy as np a = …
python numpy input python-2.x notimplementedexceptionI would like to perform the following: a=max(a,3) b=min(b,3) However sometimes a and b may be …
python python-2.xI’ve got an image read into numpy with quite a few pixels in my resulting array. I calculated a …
arrays numpy python-2.x lookup-tablesI'm using Windows and Linux machines for the same project. The default encoding for stdin on Windows is cp1252, and …
encoding stdout stdin python-2.xI'm using a pair of python programs, one of which should call the second. But this should be done in …
python daemon python-2.xHow do I compare a pandas DataFrame with None? I have a constructor that takes one of a parameter_file …
python pandas python-2.x nonetypePython 2 has both the pickle and cPickle modules for serialization. cPickle has an obvious advantage over pickle: speed. What, if …
python serialization pickle python-2.xConsider this code: a = {...} # a is an dict with arbitrary contents b = a.copy() What role does mutability play in …
python python-3.x immutability python-2.x hashable