I have data in a text file with 3 columns and 4 rows like this:
5 6.4 17
6 5.8 16
7 5.5 3.9
8 5.3 10.4
I want to read this data from the text file into 3 1D arrays each with 4 elements
I have this code:
import numpy as np
with open('data.txt','rt') as filedata:
values=np.genfromtxt('data.txt', unpack=True)
this has created a 2D (3,4) array.
I managed to split it into 3 subarrays using np.slice(values,4)
but then I didn't know how to rename and subsequently use those subarrays