NumPy array is not JSON serializable
Asked 07 September, 2021
Viewed 1.7K times
  • 64
Votes

After creating a NumPy array, and saving it as a Django context variable, I receive the following error when loading the webpage:

array([   0,  239,  479,  717,  952, 1192, 1432, 1667], dtype=int64) is not JSON serializable

What does this mean?

14 Answer