Пример #1
0
 def test_get_question_NaN_ratio(self):
     test = get_question_NaN_ratio(self.dataDict)
     self.assertDictEqual(self.questionOutputDict, test)
Пример #2
0
def filter_missing_value_questions(data_dict, tolerance, reporting=0):
    question_answered_dict = diagnostic_tools.get_question_NaN_ratio(data_dict)  
    new_questions_dict = {k:v for k, v in question_answered_dict.iteritems() if v < tolerance }    
    if reporting !=0:
        print "Number of questions reduced from ", len(question_answered_dict.keys()), " to ", len(new_questions_dict.keys())
    return new_questions_dict