title: Converting string to numpy array and vice versa in python
body: <p>I am having a <code>numpy</code> array which is the image read by open <code>cv</code> and saving it as a string. So I have converted the <code>np</code> array to string and stored the same. Now I wanted to retrieve the value(which is a string) and convert to original <code>numpy</code> array dimension. Could you all please help me in how to do that?</p>
  
  <p>My code is as below:</p>
  
  <pre><code>img = cv2.imread('9d98.jpeg',0)
  img.shape    # --&gt; (149,115)
  img_str=np.array2string(img,precision=2,separator=',') # to string length 197? which I dont know how
  img_numpy=np.fromstring(img_str,dtype=np.uint8) # shape (197,) since this is returning only 1D array
  </code></pre>
  
  <p>Please help me in resolving the same</p>