I have a json file that has over 1000 records in it all similar to the one below:
[{"id":0,"occupation":"teacher","county":"Santa Rosa","grade":"3rd","workID":"147767"},

I want to extract all the records that have a certain occupation, in this case I want to return the records where the occupations are teacher.
This is what I have tried:
specified_occ = {}
for o in data:
    specified_occ[o["occupation"]] = o
specOcc = (specified_occ['teacher'])  

but it only returns the first instance rather than all of them that match.
My dataset has 50 records where the occupation is 'teacher' I want every record returned.

How to extract specific records from a JSON file that all have the same value in a specified field with python?
You can use a list comprehension to filter over your data and only select the needed elements. In general a list comprehension looks like this
filtered_list = [element for element in original_list if element == requirement]

Here you only select the elements from the original list if the elements match some requirement.
For this specific problem you would use
filtered_data = [person for person in data if person['occupation'] == 'teacher']

This is syntactically equivalent to
speccified_o = []
for o in data:
    if o['occupation'] == 'teacher':
        speccified_o.append(o)

