title: Reading numpy arrays outside of Python
body: <p>In a recent <a href="https://stackoverflow.com/questions/2721521/fastest-way-to-generate-delimited-string-from-1d-numpy-array">question</a> I asked about the fastest way to convert a large numpy array to a delimited string. My reason for asking was because I wanted to take that plain text string and transmit it (over HTTP for instance) to clients written in other programming languages. A delimited string of numbers is obviously something that any client program can work with easily. However, it was suggested that because string conversion is slow, it would be faster on the Python side to do base64 encoding on the array and send it as binary. This is indeed faster.</p>
  
  <p>My question now is, (1) how can I make sure my encoded numpy array will travel well to clients on different operating systems and different hardware, and (2) how do I decode the binary data on the client side.</p>
  
  <p>For (1), my inclination is to do something like the following</p>
  
  <pre><code>import numpy as np
  import base64
  x = np.arange(100, dtype=np.float64)
  base64.b64encode(x.tostring())
  </code></pre>
  
  <p>Is there anything else I need to do?</p>
  
  <p>For (2), I would be happy to have an example in any programming language, where the goal is to take the numpy array of floats and turn them into a similar native data structure. Assume we have already done base64 decoding and have a byte array, and that we also know the numpy dtype, dimensions, and any other metadata which will be needed.</p>
  
  <p>Thanks.</p>