I noticed this problem when a computer running Ubuntu was updated recently and the default version of Python changed to 2.7.
import json
import numpy as np
json.dumps(list(np.arange(5))) # Fails, throws a "TypeError: 0 is not JSON serializable"
json.dumps(np.arange(5).tolist()) # Works
Is there a difference between list() and the tolist() methd of a numpy array?