SimpleJSON and NumPy array
问题 What is the most efficient way of serializing a numpy array using simplejson? 回答1: I'd use simplejson.dumps(somearray.tolist()) as the most convenient approach (if I was still using simplejson at all, which implies being stuck with Python 2.5 or earlier; 2.6 and later have a standard library module json which works the same way, so of course I'd use that if the Python release in use supported it;-). In a quest for greater efficiency, you could subclass json.JSONEncoder (in json ; I don't know