title: what's the format of numpy tobytes result when numpy array has different type?
body: <p>i want to save <code>pandas dataframe</code> into binary format so that i can read it in <code>c++</code>.</p>
  <p>I tried <code>tobytes</code> method like this:</p>
  <pre><code>In [2]: df = pd.DataFrame(np.reshape(range(25), (5,5)))
  
  In [3]: df[0]=101.
  
  In [4]: df['ticker'] ='nick'
  
  In [5]: a = df.to_numpy()
  
  In [6]: a
  Out[6]: 
  array([[101.0, 1, 2, 3, 4, 'nick'],
         [101.0, 6, 7, 8, 9, 'nick'],
         [101.0, 11, 12, 13, 14, 'nick'],
         [101.0, 16, 17, 18, 19, 'nick'],
         [101.0, 21, 22, 23, 24, 'nick']], dtype=object)
  
  In [7]: a.tobytes()
  Out[7]: b'0\x0f@\xfc\xf9\x7f\x00\x000iME\xfa\x7f\x00\x00PiME\xfa\x7f\x00\x00piME\xfa\x7f\x00\x00\x90iME\xfa\x7f\x00\x00pI\xe9A\xfa\x7f\x00\x00\xf0\r@\xfc\xf9\x7f\x00\x00\xd0iME\xfa\x7f\x00\x00\xf0iME\xfa\x7f\x00\x00\x10jME\xfa\x7f\x00\x000jME\xfa\x7f\x00\x00pI\xe9A\xfa\x7f\x00\x00p\x1dR\xf7\xf9\x7f\x00\x00pjME\xfa\x7f\x00\x00\x90jME\xfa\x7f\x00\x00\xb0jME\xfa\x7f\x00\x00\xd0jME\xfa\x7f\x00\x00pI\xe9A\xfa\x7f\x00\x00p\x8f\xf8A\xfa\x7f\x00\x00\x10kME\xfa\x7f\x00\x000kME\xfa\x7f\x00\x00PkME\xfa\x7f\x00\x00pkME\xfa\x7f\x00\x00pI\xe9A\xfa\x7f\x00\x00\xb0\x14\xf8\xf7\xf9\x7f\x00\x00\xb0kME\xfa\x7f\x00\x00\xd0kME\xfa\x7f\x00\x00\xf0kME\xfa\x7f\x00\x00\x10lME\xfa\x7f\x00\x00pI\xe9A\xfa\x7f\x00\x00'
   ### !!!! what's here? both in binary or hex format, it can't be interpreted
  
  
  In [8]: with open('a.bin', 'wb') as f:
     ...:     f.write(a.tobytes())
  </code></pre>
  <p>I can't read it in c++, here is my c++ read code:</p>
  <pre><code>#include &lt;fstream&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main() {
    std::fstream f(&quot;a.bin&quot;, std::ios::binary | std::ios::in);
    if (!f.is_open()) { printf(&quot;open failed&quot;); exit(1); }
    char buff[1024];
    f.read(buff, 1024);
    cout &lt;&lt; *(float*)(buff + 0*sizeof(float)) &lt;&lt; endl; // mess code, should be 101
  } 
  </code></pre>
  <p>i cant understand the byte output, it seem not 101 in binary or hex format, can you help on this?
  what did tobytes do?</p>