I am reading a dataset (separated by whitespace) from a file. I need to store all columns apart from last one in the array data, and the last column in the array target.
Can you guide me how to proceed further?
That's what I have so far:
with open(filename) as f:
data = f.readlines()
Or should I be reading line by line?
PS: The data type of columns is also different.
Edit: Sample Data
faban 1 0 0.288 withspy
faban 2 0 0.243 withoutspy
simulated 1 0 0.159 withoutspy
faban 1 1 0.189 withoutspy