def crime_comparisons(dataframe, crimes_obj):
	'''Handles the functionalities of different crime comparisons'''

	GUI4.start_user_interface()
	crime_1, crime_2 = GUI4.get_crimes()
	crimes_per_student_state = handlers.average_crimes_per_student_by_category(dataframe, 'State', crimes_obj, overall_average = True)
	crimes_per_student_sector = handlers.average_crimes_per_student_by_category(dataframe, 'Sector_desc', crimes_obj, overall_average = True)

	pltparam = plotting.pltParam()
	answers_obj = plots.Answers(crimes_obj, None, pltparam, None, None, crimes_per_student_state)
	answers_obj.visualize_answer4(crime_1, crime_2)

	answers_obj = plots.Answers(crimes_obj, None, pltparam, None, None, crimes_per_student_sector)
	answers_obj.visualize_answer4(crime_1, crime_2)
示例#2
0
def crime_comparisons(dataframe, crimes_obj):
	'''Handles the functionalities of different crime comparisons'''

	GUI4.start_user_interface()
	crime_1, crime_2 = GUI4.get_crimes()

	if len(crime_1) == 0:
		print "Thank you for using the software"
		exit()

	crimes_per_student_state = handlers.average_crimes_per_student_by_category(dataframe, 'State', crimes_obj, overall_average = True)
	crimes_per_student_sector = handlers.average_crimes_per_student_by_category(dataframe, 'Sector_desc', crimes_obj, overall_average = True)

	pltparam = plotting.pltParam()
	answers_obj_state = plots.Answers(crimes_obj, None, pltparam, None, None, crimes_per_student_state)
	state_wide_output = answers_obj_state.visualize_answer4(crime_1, crime_2, 'State')

	answers_obj_sector = plots.Answers(crimes_obj, None, pltparam, None, None, crimes_per_student_sector)
	sector_wide_output = answers_obj_sector.visualize_answer4(crime_1, crime_2, 'Sector')

	return crime_1, crime_2, state_wide_output, sector_wide_output
示例#3
0
def crime_comparisons(dataframe, crimes_obj):
    '''Handles the functionalities of different crime comparisons'''

    GUI4.start_user_interface()
    crime_1, crime_2 = GUI4.get_crimes()
    crimes_per_student_state = handlers.average_crimes_per_student_by_category(
        dataframe, 'State', crimes_obj, overall_average=True)
    crimes_per_student_sector = handlers.average_crimes_per_student_by_category(
        dataframe, 'Sector_desc', crimes_obj, overall_average=True)

    pltparam = plotting.pltParam()
    answers_obj_state = plots.Answers(crimes_obj, None, pltparam, None, None,
                                      crimes_per_student_state)
    state_wide_output = answers_obj_state.visualize_answer4(
        crime_1, crime_2, 'State')

    answers_obj_sector = plots.Answers(crimes_obj, None, pltparam, None, None,
                                       crimes_per_student_sector)
    sector_wide_output = answers_obj_sector.visualize_answer4(
        crime_1, crime_2, 'Sector')

    return crime_1, crime_2, state_wide_output, sector_wide_output
示例#4
0
def crime_comparisons():
    '''Handles the functionalities of different crime comparisons'''

    GUI4.start_user_interface()
    print GUI4.get_crimes()
def crime_comparisons():
	'''Handles the functionalities of different crime comparisons'''

	GUI4.start_user_interface()
	print GUI4.get_crimes()