how to convert string array of mixed data types
<p>Let's say I have read and loaded a file into a 2D matrix of mixed data as strings(an example has been provided below)</p>

<pre><code># an example row of the matrix
['529997' '46623448' '2122110124' '2310' '2054' '2' '66' '' '2010/11/03-12:42:08' '26' 'CLEARING' '781' '30' '3' '0' '0' '1']
</code></pre>

<p>I want to convert this chunk of data into their data types to be able to do statistical analysis on it with numpy and scipy.</p>

<p>The datatype for all of the columns is integer <strong>except</strong> the 8th index this is DateTime and the 10th index is pure string.</p>

<h3>Question:</h3>

<p>What is the easiest way to this conversation?</p>

<hr>

<h1>EDIT</h1>

<p>Performance is very important than readability, I have to convert <strong>4.5m</strong> rows of data and then process them!</p>

<p>Here is a one linear with list comprehension:</p>

<pre><code>In [24]: from datetime import datetime
In [25]: func = lambda x: datetime.strptime(x, "%Y/%m/%d-%H:%M:%S")
In [26]: [{8:func, 10:str}.get(ind)(item) if ind in {8, 10} else int(item or '0') for ind, item in enumerate(lst)]
Out[26]: 
[529997,
 46623448,
 2122110124,
 2310,
 2054,
 2,
 66,
 0,
 datetime.datetime(2010, 11, 3, 12, 42, 8),
 26,
 'CLEARING',
 781,
 30,
 3,
 0,
 0,
 1]
</code></pre>

python arrays numpy converter mixed