I've google this a bit but notice the answers always lie with numpy/panda etc. I would like to do this without any imports. I'm just learning how to use Python so apologies if I label things incorrectly.
I have a data set which has been opened and read and is like this:
['Label 1', 41.0, 34.2, 97.0, 52.0, None, None, 68.0, 58.0]
['Label 2', None, 78.0, 62.0, 75.0, None, 67.0, None, None]
['Label 3', 51.0, None, 68.0, 51.0, 66.0, None, 55.0, 72.0]
['Label 4', None, 54.0, 47.0, 59.0, None, 48.0, None, None]
All of this data I can pull from 'data_sample'
When I type in data_sample[1]. It will give me:
41.0
None
51.0
None
I want to be able to have the data that's in the 'rows' be in it's own list.
Label 1 = ['Label 1', 41.0, 34.2, 97.0, 52.0, None, None, 68.0, 58.0]
I can't specifically call only value 51 from Label 3. I can call the whole column of data, but i can't call that specific value of 51. If that helps?
Is it possible?
I tried:
for n in students_file:
if "Label 1" in n:
print(n)