title: Optimization of string to ndarray containing integers and multiple delimiters
body: <p>I streaming a large amount of ASCII data from a device and decoding it to a string type. The result is a comma and semicolon delimited string. </p>
  
  <p>'-81,-82,-82;-87,-88,-88,-88,'</p>
  
  <p>My objective is to split this string into an ndarray of dimension: [length of semicolons,length of commas]. Each array element is an integer value as seen in my example above. I have implemented two methods to achieve my objective, but they are both very time consuming (around 3-7 seconds). I am working with 10 million integers. Is it possible to reduce the processing time and if so, how should I go about this? </p>
  
  <p>Thanks</p>
  
  <pre class="lang-python prettyprint-override"><code>#Method 1 (about 3 seconds to process)
  
  BigTrace = BigTraceBytes.decode()
  Traces = BigTrace.split(';')
  
  box = np.empty([len(Traces),Record_Length])   
  idx= 0
  
  for row in Traces:
     temp = row.split(',')
     box[idx] = [float(i) for i in temp]
     idx+=1
  
  box3d = box.reshape(100,100,1000)
  
  #Method 2 (about 7 seconds to process)
  
  BigTrace = BigTraceBytes.decode()
  TraceSplit = (re.split(',|;',BigTrace))
  ArrSplit= np.array(TraceSplit)
  done = ArrSplit.astype('int')
  </code></pre>