How to read file with mixed data type into a numpy array in Python?
I'm a new python learner. I'm trying to read an existing file with mixed data type into a numpy array.
The content of file data.txt (if comma is not a good symbol, it can be replaced by space):
,'A','B','C','D'
'A', 0, 3, 5, -1
'B', 3, 0, 1, 6
'C', 5, 1, 0, 2
'D', -1, 6, 2, 0
The expected output numpy array is as follows:
array([[None,'A','B','C','D'],
['A', 0, 3, 5, -1 ],
['B', 3, 0, 1, 6 ],
['C', 5, 1, 0, 2 ],
['D', -1, 6, 2, 0 ]])