title: AttributeError: 'list' object has no attribute 'tolist'
body: <p>It's a two part question,</p>
  <pre><code>import face_recognition
  import os
  import json
  loadarr=[]
  encodearr=[]
  for i in range(0, 4):
      loadarr.append(face_recognition.load_image_file( &quot;brad&quot;+str(i+1)+&quot;.jpg&quot;))
      encodearr.append(face_recognition.face_encodings(loadarr[i])[0])
  encodearr = encodearr.tolist()
  # print(encodearr)
  encodedDic = {&quot;des&quot;: encodearr}
  
  with open(&quot;sample.json&quot;, &quot;w&quot;) as outfile:
      json.dump(encodedDic,outfile)
  </code></pre>
  <p>When I tried to convert the list <code>encodearr</code> as value of the key <code>&quot;des&quot;</code> (without .tolist()) it shows<br />
  <code>TypeError: Object of type ndarray is not JSON serializable</code> .Then I added .tolist() to encode arr as show. it shows <code>AttributeError: 'list' object has no attribute 'tolist'</code>, brad1 to brad5 are the jpg files in the directory.</p>