Guided project for google and apple store data sets

g_data_cat = freq_table(g_data_free, 1)
g_data_cat_installs = {}
for category in g_data_cat:
    total = 0
    cat_len = 0
    for app in g_data_free:
        app_cat = app[1]
        if app_cat == category:
            n_installs = app[5]
            n_installs = n_installs.replace(',', '')
            n_installs = n_installs.replace('+',"")
            total += float(n_installs)
            cat_len += 1
    n_installs_avg = round(total / cat_len, 3)
    g_data_cat_installs[n_installs_avg] = n_installs_avg
{categories: values for categories, values in sorted(g_data_cat_installs.items(), key=lambda item: item[0], reverse = True)}

so my problem is, that it’s putting out the dict in format “value : value” instead of “key : value”

so as i have been testing and playing with my code, i have come to the conclusion that python itself hates me.

send either snake capture gear, or solutions to my code weirdness please.

I’m having trouble understanding this line of code:

    g_data_cat_installs[n_installs_avg] = n_installs_avg

It looks like both the key and the value are the same.

… so it turns out that’s what the problem was… thanks.