and if you have a array with an string that i want to maintain? like ['a','1.1','2.2','3.3'] -> ['a',1.1,2.2,3.3]
– MrMartinMay 9 '15 at 20:09
3
@MrMartin - Then use a list. Numpy arrays are deliberately homogenously typed. If you really want, you can use an object array (e.g. np.array(['apple', 1.2, 1, {'b'=None, 'c'=object()}], dtype=object)). However, object arrays don't have any significant advantages over using a list.
– Joe KingtonMay 9 '15 at 20:14