length of array and string don't match when converting them back and forth
<p>I am working on a csv file, which in one column contains images (vectorized). Here is <a href="https://www.dropbox.com/s/gmb3r593uf3a1au/training.csv?dl=0" rel="nofollow noreferrer">the csv file ~240MB</a>. </p>

<p>I am trying to convert the Image string to a list of integers, reshape into matrix, flip, and the reshape it back to a list, then finally convert back in to a long string. But things didn't turn out to be what I expected. Below are my codes:</p>

<pre><code>import pandas as pd
import numpy as np
df = pd.read_csv('training.csv')
img = df['Image'][0] # take the first row as example
img_int = np.fromstring(img, sep=' ')  # img_int.shape --&gt; (9216,), good.
img_matrix = img_int.reshape(96,96)
img_matrix_flipped = np.fliplr(img_matrix) # img_matrix_flipped.shape --&gt; (96,96), good
img_matrix_flipped_vector = img_matrix_flipped.reshape(1, 9216) # img_matrix_flipped_vector.shape --&gt; (1, 9216), good
img_matrix_flipped_vector_str = str(img_matrix_flipped_vector) # len(img_matrix_flipped_vector_str) --&gt; 44, NOT GOOD!!!
</code></pre>

<p>I am confused about why the len(img_matrix_flipped_vector_str) is 44. Shouldn't the string contain all the 9216 integers in it? Please kindly help!</p>