title: Convert numpy.nd array to json
body: <p>I've a data frame genre_rail in which one column contains <code>numpy.ndarray</code>. The dataframe looks like as given below<a href="https://i.stack.imgur.com/m79ff.png" rel="noreferrer"><img src="https://i.stack.imgur.com/m79ff.png" alt="datframe"></a> </p>
  
  <p>The array in it looks like this :   </p>
  
  <pre><code>['SINGTEL_movie_22906' 'SINGTEL_movie_22943' 'SINGTEL_movie_24404'
   'SINGTEL_movie_22924' 'SINGTEL_movie_22937' 'SINGTEL_movie_22900'
   'SINGTEL_movie_24416' 'SINGTEL_movie_24422']
  </code></pre>
  
  <p>I tried with the  following code</p>
  
  <pre><code>import json
  json_content = json.dumps({'mydata': [genre_rail.iloc[i]['content_id'] for i in range(len(genre_rail))] })
  </code></pre>
  
  <p>But got an error </p>
  
  <blockquote>
    <p>TypeError: array is not JSON serializable  </p>
  </blockquote>
  
  <p>I need output as</p>
  
  <pre><code>{"Rail2_contend_id":
  ["SINGTEL_movie_22894","SINGTEL_movie_22898",
  "SINGTEL_movie_22896","SINGTEL_movie_24609","SINGTEL_movie_2455",
  "SINGTEL_movie_24550","SINGTEL_movie_24548","SINGTEL_movie_24546"]}
  </code></pre>