Better way to filter the rows with python
<pre><code>import pprint

full_key_list = set(["F1", "F2", "F3", "F4", "F5"]) # all expected field
filt_key_list = set(["F2", "F5"])                   # fields should not be included

cont_list = []                                 # stores all filtered documents

read_in_cont1 = { "F1" : 1, "F2" : True,  "F3" : 'abc', "F4" : 130, "F5" : 'X1Z'} # document1
read_in_cont2 = { "F1" : 2, "F2" : False, "F3" : 'efg', "F4" : 100, "F5" : 'X4Z'} # document1
read_in_cont3 = { "F1" : 3, "F2" : True,  "F3" : 'acd', "F4" : 400, "F5" : 'X2Z'} # document1

# assume that read_in_conts contains list of documents
read_in_conts = [read_in_cont1, read_in_cont2, read_in_cont3]

for one_item in read_in_conts: # for each document in the list
    cont_dict = {}
    for key, value in one_item.iteritems():
        if key not in filt_key_list: # if the field should be included
            cont_dict[key] = value   # add this field to the temporary document
    cont_list.append(cont_dict)

pprint.pprint(cont_list)
</code></pre>

<p>Output:</p>

<pre><code>[{'F1': 1, 'F3': 'abc', 'F4': 130},
 {'F1': 2, 'F3': 'efg', 'F4': 100},
 {'F1': 3, 'F3': 'acd', 'F4': 400}]
</code></pre>

<p>Here is what I want to achieve:</p>

<p>Given an original raw collection of documents (i.e. read_in_conts for simulation), 
I need to filter the fields so that they are not included in further process. Above
is my implementation in Python. However, I think it is too heavy and expect to see
a clean solution for this task.</p>

<p>Thank you</p>
