title: Change dtype of ndarray from object to float?
body: <p>I found a strange 3D ndarray(see attached file) that does not show the shape of the last dimension and dtype change(asarray nor astype from 'object' to np.float) does not work.</p>
  
  <p><a href="https://drive.google.com/open?id=0BzxiDcBmvq-INGxuSDlwS295WW8" rel="nofollow noreferrer">file</a></p>
  
  <p>It is an ndarray of ('object','object','float64')dtype for each dimension and the actually shape is (2,3,24) but shape is shown as (2,3), which means 24 dimensional array in (2,3) does not count.</p>
  
  <p>When I try .asarray or .astype to make this array as 'dtype=np.float' for every dimension, I got an error <code>ValueError: setting an array element with a sequence.</code></p>
  
  <p>Unfortunately, none of the methods previously discussed in here do not work for this case.
  <a href="https://stackoverflow.com/questions/4674473/valueerror-setting-an-array-element-with-a-sequence">ValueError: setting an array element with a sequence</a></p>
  
  <p><a href="https://stackoverflow.com/questions/13310347/numpy-valueerror-setting-an-array-element-with-a-sequence-this-message-may-app">Numpy ValueError: setting an array element with a sequence. This message may appear without the existing of a sequence?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/21803256/error-setting-an-array-element-with-a-sequence-python-numpy">Error: Setting an array element with a sequence. Python / Numpy</a></p>
  
  <p><a href="https://stackoverflow.com/questions/44085495/valueerror-setting-an-array-element-with-a-sequence-using-numpy">ValueError :Setting an array element with a sequence using numpy</a></p>
  
  <p><a href="https://stackoverflow.com/questions/30521680/python-numpy-error-valueerror-setting-an-array-element-with-a-sequence">Python Numpy Error: ValueError: setting an array element with a sequence</a></p>
  
  <p>How can I change the dtype of the array into np.float for all dimension so that I can utilise typical np operations? Thank you.</p>
  
  <p>*I met this problem by extracting some data points from python's collection.deque library.
  I stored a series of tuples of dtype (ndarray-float, bool), and pick a few as an ndarray via </p>
  
  <p><code>array = np.asarray(list(itertools.islice())).</code></p>
  
  <p>I extract the float-side elements by doing <code>state_array = array[:,:,0]</code>. I wanted to make state_array into purely np.float dtype-d ndarray for every dimension but couldn't. What's happening is that this state_array has 'object' as datatype <code>state_array.asarray()</code> nor <code>np.array(state_array)</code> do not work with the error-code below.</p>
  
  <p><code>ValueError: setting an array element with a sequence.</code></p>