Exemplo n.º 1
0
def interface(dataframe, crimes_obj):
	'''Run the interace every time for the user'''

	try:

		igui.initial_gui()
		user_feature_choice = igui.get_result()

		if user_feature_choice == 1:
			university_name, branch_name, multibar_plot, pie_chart = university_crime_explorer(dataframe, crimes_obj, "", "", True)
			plot1.plotting1(multibar_plot, pie_chart, university_name, branch_name)


		elif user_feature_choice == 2:
			multibar_plot_1, multibar_plot_2, pie_chart_1, pie_chart_2, university_name_1, branch_name_1, university_name_2, branch_name_2 = university_comparer(dataframe, crimes_obj)
			plot2.plotting2(multibar_plot_1, multibar_plot_2, pie_chart_1, pie_chart_2, university_name_1, branch_name_1, university_name_2, branch_name_2)

		elif user_feature_choice == 3:
			bar_chart, specific_choice = category_wise_crime(dataframe, crimes_obj)
			plot3.plotting3(bar_chart, specific_choice)

		else:
			crime_1, crime_2, state_wide_output, sector_wide_output = crime_comparisons(dataframe, crimes_obj)
			plot4.plotting4(state_wide_output, sector_wide_output, crime_1, crime_2)

	except (NameError, KeyError):
		print "Thanks for using!"
Exemplo n.º 2
0
def interface(dataframe, crimes_obj):
    '''Run the interace every time for the user'''

    try:

        igui.initial_gui()
        user_feature_choice = igui.get_result()

        if user_feature_choice == 1:
            university_name, branch_name, multibar_plot, pie_chart = university_crime_explorer(
                dataframe, crimes_obj, "", "", True)
            plot1.plotting1(multibar_plot, pie_chart, university_name,
                            branch_name)

        elif user_feature_choice == 2:
            multibar_plot_1, multibar_plot_2, pie_chart_1, pie_chart_2, university_name_1, branch_name_1, university_name_2, branch_name_2 = university_comparer(
                dataframe, crimes_obj)
            plot2.plotting2(multibar_plot_1, multibar_plot_2, pie_chart_1,
                            pie_chart_2, university_name_1, branch_name_1,
                            university_name_2, branch_name_2)

        elif user_feature_choice == 3:
            bar_chart, specific_choice = category_wise_crime(
                dataframe, crimes_obj)
            plot3.plotting3(bar_chart, specific_choice)

        else:
            crime_1, crime_2, state_wide_output, sector_wide_output = crime_comparisons(
                dataframe, crimes_obj)
            plot4.plotting4(state_wide_output, sector_wide_output, crime_1,
                            crime_2)

    except (NameError, KeyError):
        print "Thanks for using!"
Exemplo n.º 3
0
def interface(dataframe):
    '''Run the interace every time for the user'''

    igui.initial_gui()
    user_feature_choice = igui.get_result()

    if user_feature_choice == 1:
        print "Enter"
        university_crime_explorer(dataframe)

    elif user_feature_choice == 2:
        university_comparer(dataframe)

    elif user_feature_choice == 3:
        category_wise_crime(dataframe)

    else:
        crime_comparisons()
Exemplo n.º 4
0
def interface(dataframe):
	'''Run the interace every time for the user'''

	igui.initial_gui()
	user_feature_choice = igui.get_result()

	if user_feature_choice == 1:
		print "Enter"
		university_crime_explorer(dataframe)

	elif user_feature_choice == 2:
		university_comparer(dataframe)

	elif user_feature_choice == 3:
		category_wise_crime(dataframe)

	else:
		crime_comparisons()
Exemplo n.º 5
0
def interface(dataframe, crimes_obj):
	'''Run the interace every time for the user'''

	igui.initial_gui()
	user_feature_choice = igui.get_result()

	if user_feature_choice == 1:
		university_name, branch_name, multibar_plot, pie_chart = university_crime_explorer(dataframe, crimes_obj, "", "", True)
		plot1.plotting1(multibar_plot, pie_chart, university_name, branch_name)

	elif user_feature_choice == 2:
		multibar_plot_1, multibar_plot_2, pie_chart_1, pie_chart_2, university_name_1, branch_name_1, university_name_2, branch_name_2 = university_comparer(dataframe, crimes_obj)
		plot2.plotting1(multibar_plot_1, multibar_plot_2, pie_chart_1, pie_chart_2, university_name_1, branch_name_1, university_name_2, branch_name_2)

	elif user_feature_choice == 3:
		bar_chart, specific_choice = category_wise_crime(dataframe, crimes_obj)
		plot3.plotting2(bar_chart, specific_choice)

	else:
		crime_comparisons(dataframe, crimes_obj)
Exemplo n.º 6
0
def interface(dataframe, crimes_obj):
    '''Run the interace every time for the user'''

    igui.initial_gui()
    user_feature_choice = igui.get_result()

    if user_feature_choice == 1:
        university_name, branch_name, multibar_plot, pie_chart = university_crime_explorer(
            dataframe, crimes_obj, "", "", True)
        plot1.plotting1(multibar_plot, pie_chart, university_name, branch_name)

    elif user_feature_choice == 2:
        multibar_plot_1, multibar_plot_2, pie_chart_1, pie_chart_2, university_name_1, branch_name_1, university_name_2, branch_name_2 = university_comparer(
            dataframe, crimes_obj)
        plot2.plotting1(multibar_plot_1, multibar_plot_2, pie_chart_1,
                        pie_chart_2, university_name_1, branch_name_1,
                        university_name_2, branch_name_2)

    elif user_feature_choice == 3:
        bar_chart, specific_choice = category_wise_crime(dataframe, crimes_obj)
        plot3.plotting2(bar_chart, specific_choice)

    else:
        crime_comparisons(dataframe, crimes_obj)