I am loading data from a file and want it to be stored in a matrix. I am looking to read the data in as a float rather than a string. How do I do this?
with open("hw2_data.txt", "r") as dataFile:
X = [line.split() for line in dataFile]
I have tried various things with float() but cannot seem to figure it out.