Python Script for Pulling in the Same Column from an Array of Arrays

Imagine that we have a CSV file:

23,32000,High School,Single,no_purchase
,21000,High School,Single,purchased
62,85000,High School,Married,no_purchase
,0,High School,Married,purchased
54,35000,High School,Married,no_purchase


That get converted into a Python collection, where each line in the CSV file represents an element from the list. If you want to return all of the education levels from the collection, you can run the script (for the example we're storing the collection in a variable called features):

features[1, 2]


This code will query the nested collections and return a single element from each collection, at the index of 2, the the output will be:

       ['High School'],
       ['High School'],
       ['High School'],
       ['High School'],
       ['High School'],
       ['Masters']], dtype=object)