Guided Project App Profile Recommendation---------popular app

Screen Link:
https://app.dataquest.io/c/112/m/350/guided-project%3A-profitable-app-profiles-for-the-app-store-and-google-play-markets/12/most-popular-apps-by-genre-on-the-app-store

My Code:

prime_genre=freq_table(free_ios_apps,11)

total=0
len_genre=0
for each_row in free_ios_apps:
    genre=each_row[11]
    
    for genre in prime_genre:
        if genre in prime_genre:
            app=each_row[1]
            rating=float(each_row[5])
            len_genre+=1
            total+=rating

    avg_app_genre=total/len_genre
      

    print(genre,':',avg_app_genre)
        

What I expected to happen:
I was expecting to get an average user rating per genre

What actually happened:

3222
Medical : 2974676.0
Medical : 2568117.0
Medical : 2422346.3333333335
Medical : 2247896.25
Medical : 2023692.8
Medical : 1863348.0
Medical : 1738001.142857143
Medical : 1640975.25
Medical : 1556262.7777777778
Medical : 1483081.6
Medical : 1412447.8181818181
Medical : 1351331.75
Medical : 1299479.076923077
Medical : 1254450.5
Medical : 1211655.9333333333
Medical : 1171386.4375
Medical : 1132411.2352941176
Medical : 1097705.388888889
Medical : 1066417.2105263157
Medical : 1037877.65
Medical : 1011386.5238095238
Medical : 987207.1363636364
Medical : 964472.5652173914
Medical : 942906.2083333334
Medical : 923037.36
Medical : 903614.1153846154
Medical : 885620.2222222222
Medical : 868874.3571428572
Medical : 853216.724137931
Medical : 838297.7333333333
Medical : 824320.6129032258
Medical : 811152.0
Medical : 798624.0606060605
Medical : 786707.7352941176
Medical : 775413.2571428572
Medical : 764610.6944444445
Medical : 754049.7837837838
Medical : 744044.1315789474
Medical : 734543.4871794871
Medical : 725439.15
Medical : 716521.9024390244
Medical : 707891.8095238095
Medical : 699602.8372093023
Medical : 691544.7272727273
Medical : 683798.6
Medical : 676200.6521739131
Medical : 668771.3829787234
Medical : 661586.6666666666
Medical : 654387.8367346938
Medical : 647377.2
Medical : 640589.0588235294
Medical : 633947.1730769231
Medical : 627530.3773584906
Medical : 621339.5925925926
Medical : 615347.7272727273
Medical : 609555.7321428572
Medical : 603907.1929824562
Medical : 598444.9137931034
Medical : 593016.4576271187
Medical : 587753.9833333333
Medical : 582618.6885245901
Medical : 577534.4193548387
Medical : 572604.0476190476
Medical : 567754.625
Medical : 563034.7846153846
Medical : 558422.5
Medical : 553933.0149253731
Medical : 549567.8235294118
Medical : 545276.231884058
Medical : 541087.6571428571
Medical : 536956.9718309859
Medical : 532859.3611111111
Medical : 528759.904109589
Medical : 524766.7972972973
Medical : 520875.7733333333
Medical : 517052.2631578947
Medical : 513244.8961038961
Medical : 509498.1923076923
Medical : 505808.64556962025
Medical : 502094.1375
Medical : 498365.16049382713
Medical : 494719.1951219512
Medical : 491148.3373493976
Medical : 487659.0714285714
Medical : 484165.08235294116
Medical : 480728.0813953488
Medical : 477369.9195402299
Medical : 474077.82954545453
Medical : 470858.7415730337
Medical : 467708.2555555556
Medical : 464619.73626373627
Medical : 461592.22826086957
Medical : 458603.29032258067
Medical : 455675.8617021277
Medical : 452808.3157894737
Medical : 449980.9791666667
Medical : 447211.6804123711
Medical : 444485.9183673469
Medical : 441808.44444444444
Medical : 439181.47
Medical : 436590.57425742573
Medical : 434040.8039215686
Medical : 431503.3786407767
Medical : 428999.0673076923
Medical : 426540.4380952381
Medical : 424107.7358490566
Medical : 421685.8224299065
Medical : 419304.31481481483
Medical : 416965.53211009176
Medical : 414668.10909090907
Medical : 412398.13513513515
Medical : 410154.08928571426
Medical : 407946.2477876106
Medical : 405768.9561403509
Medical : 403625.94782608695
Medical : 401515.7672413793
Medical : 399433.4273504274
Medical : 397369.6101694915
Medical : 395332.14285714284
Medical : 393300.7
Medical : 391291.2561983471
Medical : 389306.39344262297
Medical : 387345.85365853657
Medical : 385395.87903225806
Medical : 383473.056
Medical : 381574.1746031746
Medical : 379695.9527559055
Medical : 377838.640625
Medical : 376007.5968992248
Medical : 374201.56923076924
Medical : 372409.8473282443
Medical : 370639.51515151514
Medical : 368889.97744360904
Medical : 367160.3656716418
Medical : 365454.23703703703
Medical : 363766.79411764705
Medical : 362102.39416058396
Medical : 360450.05797101447
Medical : 358816.56115107914
Medical : 357201.46428571426
Medical : 355602.12765957444
Medical : 354019.176056338
Medical : 352456.2377622378
Medical : 350914.52777777775
Medical : 349382.2827586207
Medical : 347858.7602739726
Medical : 346351.6394557823
Medical : 344864.35135135136
Medical : 343386.1879194631
Medical : 341922.67333333334
Medical : 340475.72185430466
Medical : 339046.7236842105
Medical : 337636.0588235294
Medical : 336243.55194805196
Medical : 334867.9935483871
Medical : 333509.01923076925
Medical : 332163.4840764331
Medical : 330833.84810126584
Medical : 329506.4213836478
Medical : 328193.8
Medical : 326896.42236024846
Medical : 325606.2530864198
Medical : 324329.3435582822
Medical : 323067.2012195122
Medical : 321816.00606060604
Medical : 320566.9638554217
Medical : 319330.6107784431
Medical : 318108.16071428574
Medical : 316900.04142011836
Medical : 315704.8
Medical : 314518.7251461988
Medical : 313345.81395348837
Medical : 312185.450867052
Medical : 311032.5402298851
Medical : 309886.1828571429
Medical : 308750.8181818182
Medical : 307625.384180791
Medical : 306511.47191011236
Medical : 305408.6368715084
Medical : 304314.7388888889
Medical : 303231.13812154694
Medical : 302159.15934065933
Medical : 301097.7213114754
Medical : 300047.2826086957
Medical : 299008.0918918919
Medical : 297972.74731182796
Medical : 296948.2834224599
Medical : 295933.8510638298
Medical : 294925.8888888889
Medical : 293927.72105263156
Medical : 292936.1570680628
Medical : 291954.7291666667
Medical : 290981.18134715024
Medical : 290015.58247422683
Medical : 289049.75384615385
Medical : 288093.3724489796
Medical : 287144.78680203046
Medical : 286202.0202020202
Medical : 285266.5075376884
Medical : 284336.395
Medical : 283415.34825870645
Medical : 282501.297029703
Medical : 281594.118226601
Medical : 280691.04901960783
Medical : 279795.59024390246
Medical : 278908.58252427186
Medical : 278027.5458937198
Medical : 277151.89423076925
Medical : 276274.5215311005
Medical : 275391.5523809524
Medical : 274515.2701421801
Medical : 273646.8679245283
Medical : 272786.3427230047
Medical : 271928.0420560748
Medical : 271076.6790697674
Medical : 270232.537037037
Medical : 269395.5806451613
Medical : 268563.2981651376
Medical : 267738.34246575343
Medical : 266910.14545454545
Medical : 266088.8099547511
Medical : 265271.65315315314
Medical : 264459.0538116592
Medical : 263652.46875
Medical : 262847.8
Medical : 262046.03097345133
Medical : 261249.84140969164
Medical : 260459.29824561405
Medical : 259674.76419213973
Medical : 258895.41304347827
Medical : 258122.30735930736
Medical : 257354.78879310345
Medical : 256593.2017167382
Medical : 255834.57264957266
Medical : 255081.73617021277
Medical : 254335.16101694916
Medical : 253592.86919831223
Medical : 252849.29411764705
Medical : 252110.97907949792
Medical : 251376.44166666668
Medical : 250647.8796680498
Medical : 249925.01239669422
Medical : 249206.85185185185
Medical : 248493.0286885246
Medical : 247776.6857142857
Medical : 247062.90650406503
Medical : 246353.56680161942
Medical : 245646.19758064515
Medical : 244941.93975903615
Medical : 244242.66
Medical : 243546.96812749005
Medical : 242856.74206349207
Medical : 242171.01581027667
Medical : 241488.88976377953
Medical : 240807.99607843137
Medical : 240131.24609375
Medical : 239453.70817120624
Medical : 238781.41472868217
Medical : 238113.65250965251
Medical : 237449.56153846154
Medical : 236789.60536398468
Medical : 236134.5114503817
Medical : 235483.87072243346
Medical : 234837.8143939394
Medical : 234195.35471698112
Medical : 233556.4962406015
Medical : 232918.79775280898
Medical : 232281.26865671642
Medical : 231647.22676579925
Medical : 231013.93703703705
Medical : 230385.1070110701
Medical : 229760.49264705883
Medical : 229140.44688644688
Medical : 228524.4598540146
Medical : 227912.6290909091
Medical : 227305.10507246378
Medical : 226701.70397111913
Medical : 226100.75899280576
Medical : 225502.74551971327
Medical : 224908.65714285715
Medical : 224317.3024911032
Medical : 223729.79432624113
Medical : 223144.50176678447
Medical : 222561.24647887325
Medical : 221981.550877193
Medical : 221404.17482517482
Medical : 220829.24390243902
Medical : 220257.59375
Medical : 219689.81660899654
Medical : 219125.74827586208
Medical : 218565.36426116838
Medical : 218008.4623287671
Medical : 217454.7918088737
Medical : 216904.77551020408
Medical : 216357.80338983051
Medical : 215813.81756756757
Medical : 215272.93265993267
Medical : 214735.36241610738
Medical : 214201.16722408027
Medical : 213669.26333333334
Medical : 213140.62458471762
Medical : 212615.31125827815
Medical : 212092.75907590758
Medical : 211573.34868421053
Medical : 211057.28852459017
Medical : 210542.78758169935
Medical : 210031.2345276873
Medical : 209522.9025974026
Medical : 209017.6990291262
Medical : 208515.33548387096
Medical : 208015.807073955
Medical : 207518.41987179487
Medical : 207023.607028754
Medical : 206528.07643312102
Medical : 206035.38412698414
Medical : 205543.47784810126
Medical : 205052.22397476342
Medical : 204563.49056603774
Medical : 204077.64263322885
Medical : 203594.61875
Medical : 203114.4672897196
Medical : 202636.44720496895
Medical : 202160.4984520124
Medical : 201687.2314814815
Medical : 201216.4830769231
Medical : 200747.74233128835
Medical : 200280.72171253822
Medical : 199816.44817073172
Medical : 199354.88753799393
Medical : 198896.08181818182
Medical : 198439.68580060423
Medical : 197985.9608433735
Medical : 197534.06906906908
Medical : 197084.5119760479
Medical : 196637.01194029851
Medical : 196191.43154761905
Medical : 195748.30860534124
Medical : 195307.3520710059
Medical : 194868.0501474926
Medical : 194431.2705882353
Medical : 193995.09677419355
Medical : 193561.12865497076
Medical : 193128.9387755102
Medical : 192699.11627906977
Medical : 192271.6608695652
Medical : 191844.03468208094
Medical : 191418.65417867436
Medical : 190994.683908046
Medical : 190572.83667621776
Medical : 190153.14857142858
Medical : 189735.8091168091
Medical : 189319.5596590909
Medical : 188905.23796033993
Medical : 188491.4802259887
Medical : 188079.71830985916
Medical : 187669.54494382022
Medical : 187260.74789915967
Medical : 186853.3938547486
Medical : 186447.8885793872
Medical : 186044.60555555555
Medical : 185643.41274238226
Medical : 185244.14364640883
Medical : 184846.87603305784
Medical : 184450.6456043956
Medical : 184056.34520547945
Medical : 183663.96721311475
Medical : 183273.13079019074
Medical : 182883.3097826087
Medical : 182495.33875338754
Medical : 182109.24864864865
Medical : 181725.22911051213
Medical : 181342.90860215054
Medical : 180962.63538873996
Medical : 180584.39572192513
Medical : 180208.0
Medical : 179833.48670212767
Medical : 179460.49867374005
Medical : 179088.06613756614
Medical : 178717.308707124
Medical : 178348.1157894737
Medical : 177980.1653543307
Medical : 177613.9214659686
Medical : 177249.32114882505
Medical : 176885.609375
Medical : 176523.62597402598
Medical : 176162.95336787566
Medical : 175803.0465116279
Medical : 175443.79639175258
Medical : 175086.3676092545
Medical : 174730.64615384614
Medical : 174375.78772378518
Medical : 174022.19897959183
Medical : 173670.262086514
Medical : 173320.08883248732
Medical : 172971.39746835444
Medical : 172624.42424242425
Medical : 172278.87153652392
Medical : 171934.09547738693
Medical : 171590.89724310776
Medical : 171248.655
Medical : 170908.07730673318
Medical : 170568.96517412935
Medical : 170231.5334987593
Medical : 169895.5816831683
Medical : 169561.09382716048
Medical : 169227.99261083745
Medical : 168896.07616707616
Medical : 168565.54411764705
Medical : 168236.45721271393
Medical : 167908.85853658538
Medical : 167582.6909975669
Medical : 167257.99514563108
Medical : 166934.66828087167
Medical : 166612.84057971014
Medical : 166291.86265060242
Medical : 165972.12740384616
Medical : 165652.96402877697
Medical : 165335.15071770336
Medical : 165018.7494033413
Medical : 164703.36666666667
Medical : 164389.4085510689
Medical : 164076.8720379147
Medical : 163765.79669030732
Medical : 163455.9599056604
Medical : 163147.45411764705
Medical : 162840.10093896714
Medical : 162533.7306791569
Medical : 162228.70093457945
Medical : 161924.50116550116
Medical : 161620.7488372093
Medical : 161318.29002320184
Medical : 161017.13425925927
Medical : 160717.27944572747
Medical : 160418.6589861751
Medical : 160121.06896551725
Medical : 159824.5642201835
Medical : 159529.0938215103
Medical : 159234.89497716894
Medical : 158941.76765375855
Medical : 158649.70454545456
Medical : 158357.79591836734
Medical : 158067.13574660633
Medical : 157777.63205417607
Medical : 157488.82657657657
Medical : 157201.19325842697
Medical : 156914.8116591928
Medical : 156628.89485458613
Medical : 156344.24776785713
Medical : 156060.83073496658
Medical : 155778.64666666667
Medical : 155497.32372505544
Medical : 155217.24115044248
Medical : 154938.0728476821
Medical : 154659.9140969163
Medical : 154382.93186813185
Medical : 154107.1052631579
Medical : 153832.3851203501
Medical : 153558.78602620086
Medical : 153286.02396514162
Medical : 153014.22826086957
Medical : 152743.5162689805
Medical : 152473.91774891774
Medical : 152205.47948164147
Medical : 151938.125
Medical : 151671.14193548387
Medical : 151405.21673819743
Medical : 151140.40471092076
Medical : 150876.66666666666
Medical : 150613.9488272921
Medical : 150352.1234042553
Medical : 150091.12314225052
Medical : 149831.00847457626
Medical : 149571.58139534883
Medical : 149312.97046413503
Medical : 149055.01894736843
Medical : 148797.9642857143
Medical : 148541.96226415093
Medical : 148286.33682008367
Medical : 148031.6388308977
Medical : 147777.98541666666
Medical : 147525.3471933472
Medical : 147273.6908713693
Medical : 147022.73084886128
Medical : 146772.5743801653
Medical : 146523.2680412371
Medical : 146274.93621399178
Medical : 146027.62422997947
Medical : 145781.26844262294
Medical : 145535.73619631902
Medical : 145291.1387755102
Medical : 145046.96741344195
Medical : 144803.36178861788
Medical : 144560.6612576065
Medical : 144318.63360323888
Medical : 144077.45454545456
Medical : 143837.13306451612
Medical : 143597.63782696176
Medical : 143359.0080321285
Medical : 143121.30260521043
Medical : 142884.264
Medical : 142648.0618762475
Medical : 142412.72111553786
Medical : 142178.1630218688
Medical : 141944.19444444444
Medical : 141711.12475247524
Medical : 141478.68577075098
Medical : 141247.08481262327
Medical : 141016.218503937
Medical : 140786.25540275048
Medical : 140557.0862745098
Medical : 140328.78473581214
Medical : 140101.1484375
Medical : 139874.3918128655
Medical : 139648.43968871597
Medical : 139423.20970873785
Medical : 139198.6608527132
Medical : 138974.93036750483
Medical : 138751.61583011583
Medical : 138528.97495183043
Medical : 138307.11153846153
Medical : 138086.07677543187
Medical : 137865.72605363984
Medical : 137646.1261950287
Medical : 137427.14885496182
Medical : 137208.9580952381
Medical : 136991.43536121672
Medical : 136774.61859582542
Medical : 136558.51893939395
Medical : 136342.93194706994
Medical : 136128.05471698113
Medical : 135913.96045197741
Medical : 135700.4454887218
Medical : 135487.6904315197
Medical : 135275.73220973782
Medical : 135064.1495327103
Medical : 134853.1791044776
Medical : 134642.98137802607
Medical : 134433.38661710036
Medical : 134224.52690166977
Medical : 134016.38888888888
Medical : 133808.97227356746
Medical : 133602.19003690037
Medical : 133395.92633517494
Medical : 133190.3474264706
Medical : 132985.35963302752
Medical : 132781.04945054944
Medical : 132577.4533820841
Medical : 132374.58759124088
Medical : 132171.883424408
Medical : 131969.90181818182
Medical : 131768.5499092559
Medical : 131567.91123188406
Medical : 131367.99095840869
Medical : 131168.74909747293
Medical : 130970.21081081081
Medical : 130772.3381294964
Medical : 130575.15798922801
Medical : 130378.62724014337
Medical : 130182.79964221825
Medical : 129987.6625
Medical : 129793.05347593583
Medical : 129599.12455516015
Medical : 129405.60746003552
Medical : 129212.72695035461
Medical : 129020.39646017698
Medical : 128828.45759717314
Medical : 128637.19576719576
Medical : 128446.5
Medical : 128256.35500878734
Medical : 128066.87192982456
Medical : 127878.03852889668
Medical : 127689.69755244756
Medical : 127501.87783595113
Medical : 127314.70557491289
Medical : 127128.18260869566
Medical : 126942.16319444444
Medical : 126756.78162911611
Medical : 126571.98788927335
Medical : 126387.53886010362
Medical : 126203.31896551725
Medical : 126019.41480206541
Medical : 125836.14089347079
Medical : 125653.47169811321
Medical : 125471.18664383562
Medical : 125289.29914529914
Medical : 125107.94880546075
Medical : 124927.13628620103
Medical : 124746.79081632652
Medical : 124566.98471986418
Medical : 124387.75423728813
Medical : 124209.00846023689
Medical : 124030.8429054054
Medical : 123853.27487352445
Medical : 123676.03367003366
Medical : 123499.34117647058
Medical : 123323.15436241611
Medical : 123147.54103852596
Medical : 122972.40802675585
Medical : 122797.75959933222
Medical : 122623.62333333334
Medical : 122449.90515806989
Medical : 122276.73588039867
Medical : 122104.03980099503
Medical : 121931.8013245033
Medical : 121760.07438016529
Medical : 121588.91089108911
Medical : 121418.13014827018
Medical : 121247.87993421052
Medical : 121078.12479474548
Medical : 120908.92295081967
Medical : 120740.27495908347
Medical : 120571.89869281046
Medical : 120403.89885807504
Medical : 120236.32899022801
Medical : 120069.26016260163
Medical : 119902.73051948052
Medical : 119736.65802269043
Medical : 119571.02588996764
Medical : 119405.73182552504
Medical : 119240.90483870968
Medical : 119076.2850241546
Medical : 118912.14147909968
Medical : 118748.50722311396
Medical : 118585.36538461539
Medical : 118422.7088
Medical : 118260.49840255591
Medical : 118098.78628389155
Medical : 117937.5652866242
Medical : 117776.8521462639
Medical : 117616.60158730159
Medical : 117456.83676703645
Medical : 117297.52531645569
Medical : 117138.64928909953
Medical : 116980.20189274447
Medical : 116822.25354330709
Medical : 116664.78773584905
Medical : 116507.6295133438
Medical : 116350.91379310345
Medical : 116194.58998435055
Medical : 116038.75
Medical : 115883.28393135725
Medical : 115728.26012461059
Medical : 115573.63608087091
Medical : 115419.42080745341
Medical : 115265.62480620155
Medical : 115112.30495356038
Medical : 114959.29675425039
Medical : 114806.74382716049
Medical : 114654.47457627118
Medical : 114502.54461538461
Medical : 114351.044546851
Medical : 114199.89417177915
Medical : 114049.20061255743
Medical : 113898.74923547401
Medical : 113748.70076335878
Medical : 113599.09146341463
Medical : 113449.9193302892
Medical : 113301.14133738601
Medical : 113152.57966616085
Medical : 113004.41666666667
Medical : 112856.65809379728
Medical : 112709.27643504532
Medical : 112562.18099547511
Medical : 112415.34036144578
Medical : 112268.93082706767
Medical : 112122.87387387388
Medical : 111977.24137931035
Medical : 111831.68263473053
Medical : 111686.52914798206
Medical : 111541.74626865672
Medical : 111397.38152011922
Medical : 111253.32738095238
Medical : 111109.69985141158
Medical : 110966.36943620178
Medical : 110823.4637037037
Medical : 110680.91568047338
Medical : 110538.70162481537
Medical : 110396.70943952803
Medical : 110255.12812960235
Medical : 110113.86764705883
Medical : 109973.0073421439
Medical : 109832.46480938417
Medical : 109692.30600292826
Medical : 109552.27923976608
Medical : 109412.63795620437
Medical : 109273.36297376093
Medical : 109134.45269286753
Medical : 108995.89244186046
Medical : 108857.5442670537
Medical : 108719.58260869565
Medical : 108581.98118668597
Medical : 108444.69508670521
Medical : 108307.79365079365
Medical : 108171.2795389049
Medical : 108035.14676258992
Medical : 107899.29454022988
Medical : 107763.7761836442
Medical : 107628.63610315186
Medical : 107493.75250357654
Medical : 107359.25428571428
Medical : 107225.07560627675
Medical : 107091.21794871795
Medical : 106957.71834992888
Medical : 106824.59232954546
Medical : 106691.70921985815
Medical : 106559.15155807366
Medical : 106426.95615275814
Medical : 106295.01977401129
Medical : 106163.40761636107
Medical : 106032.13943661972
Medical : 105901.08720112518
Medical : 105770.35393258427
Medical : 105639.97615708275
Medical : 105509.94397759104
Medical : 105380.25034965035
Medical : 105250.88547486033
Medical : 105121.7810320781
Medical : 104993.01671309193
Medical : 104864.60222531293
Medical : 104736.48055555555
Medical : 104608.71289875174
Medical : 104481.24653739612
Medical : 104354.12586445367
Medical : 104227.26657458564
Medical : 104100.75448275862
Medical : 103974.4476584022
Medical : 103848.38376891334
Medical : 103722.62774725274
Medical : 103597.15226337449
Medical : 103471.91917808219
Medical : 103346.9562243502
Medical : 103222.33333333333
Medical : 103098.04911323328
Medical : 102974.04495912806
Medical : 102850.37823129252
Medical : 102727.04483695653
Medical : 102604.0420624152
Medical : 102481.35636856369
Medical : 102358.92151556157
Medical : 102236.81351351351
Medical : 102115.00539811066
Medical : 101993.52425876011
Medical : 101872.34185733512
Medical : 101751.47177419355
Medical : 101630.91006711409
Medical : 101510.6273458445
Medical : 101390.6345381526
Medical : 101270.96122994652
Medical : 101151.54472630174
Medical : 101032.38933333334
Medical : 100913.50199733689
Medical : 100794.86170212766
Medical : 100676.52988047809
Medical : 100558.49336870026
Medical : 100440.75364238411
Medical : 100323.24206349206
Medical : 100205.9431968296
Medical : 100088.9234828496
Medical : 99972.12252964427
Medical : 99855.60789473684
Medical : 99739.29434954008
Medical : 99623.26509186352
Medical : 99507.500655308
Medical : 99391.98036649215
Medical : 99276.66274509804
Medical : 99161.61618798955
Medical : 99046.83441981747
Medical : 98932.35026041667
Medical : 98818.13394018206
Medical : 98704.2025974026
Medical : 98590.52658884565
Medical : 98477.11917098446
Medical : 98363.99741267788
Medical : 98251.1511627907
Medical : 98138.5858064516
Medical : 98026.21520618557
Medical : 97914.04633204633
Medical : 97802.13753213368
Medical : 97690.42490372273
Medical : 97578.98974358974
Medical : 97467.75032010244
Medical : 97356.78516624041
Medical : 97246.04469987229
Medical : 97135.54974489796
Medical : 97025.25605095542
Medical : 96915.19083969465
Medical : 96805.40152477764
Medical : 96695.84137055838
Medical : 96586.42712294043
Medical : 96477.27721518987
Medical : 96368.32743362832
Medical : 96259.62752525252
Medical : 96151.20176544767
Medical : 96043.04534005038
Medical : 95935.14591194969
Medical : 95827.38693467337
Medical : 95719.85194479297
Medical : 95612.58145363409
Medical : 95505.56821026283
Medical : 95398.82
Medical : 95292.17353308364
Medical : 95185.73690773068
Medical : 95079.55292652553
Medical : 94973.58208955223
Medical : 94867.86956521739
Medical : 94762.34987593052
Medical : 94657.06319702603
Medical : 94552.00247524753
Medical : 94447.14833127317
Medical : 94342.52098765432
Medical : 94238.07274969174
Medical : 94133.73891625616
Medical : 94029.65928659287
Medical : 93925.80958230958
Medical : 93822.11042944786
Medical : 93718.64828431372
Medical : 93615.34638922889
Medical : 93512.27506112469
Medical : 93409.43833943833
Medical : 93306.85
Medical : 93204.48964677223
Medical : 93102.36618004866
Medical : 93000.36087484812
Medical : 92898.59101941748
Medical : 92797.04363636364
Medical : 92695.73244552058
Medical : 92594.66021765418
Medical : 92493.83212560386
Medical : 92393.23039806997
Medical : 92292.83855421687
Medical : 92192.64741275572
Medical : 92092.66947115384
Medical : 91992.93037214885
Medical : 91893.42565947243
Medical : 91794.11736526946
Medical : 91695.00837320574
Medical : 91596.11589008363
Medical : 91497.43914081146
Medical : 91398.9904648391
Medical : 91300.74523809523
Medical : 91202.73246135552
Medical : 91104.79809976247
Medical : 91007.08185053381
Medical : 90909.54146919432
Medical : 90812.19408284024
Medical : 90715.0437352246
Medical : 90618.09090909091
Medical : 90521.3396226415
Medical : 90424.79858657243
Medical : 90328.48352941177
Medical : 90232.36897767332
Medical : 90136.46244131455
Medical : 90040.77608440797
Medical : 89945.2412177986
Medical : 89849.88070175439
Medical : 89754.73130841121
Medical : 89659.79463243874
Medical : 89565.07692307692
Medical : 89470.5203725262
Medical : 89376.16395348837
Medical : 89282.01161440185
Medical : 89188.0313225058
Medical : 89094.22595596756
Medical : 89000.62962962964
Medical : 88907.24277456648
Medical : 88814.01963048498
Medical : 88720.98961937716
Medical : 88628.16474654379
Medical : 88535.49021864212
Medical : 88443.0091954023
Medical : 88350.7233065442
Medical : 88258.63990825688
Medical : 88166.76174112257
Medical : 88075.06636155606
Medical : 87983.568
Medical : 87892.27739726027
Medical : 87801.14481185861
Medical : 87710.18109339407
Medical : 87619.39249146757
Medical : 87528.79204545454
Medical : 87438.371169126
Medical : 87348.07256235828
Medical : 87257.94450736127
Medical : 87168.00791855203
Medical : 87078.27118644067
Medical : 86988.73476297969
Medical : 86899.3900789177
Medical : 86810.19256756757
Medical : 86721.18335208099
Medical : 86632.36629213483
Medical : 86543.72839506173
Medical : 86455.27802690583
Medical : 86366.9843225084
Medical : 86278.84787472036
Medical : 86190.90391061452
Medical : 86103.13839285714
Medical : 86015.54849498328
Medical : 85928.14476614699
Medical : 85840.92547274749
Medical : 85753.89222222222
Medical : 85667.04328523863
Medical : 85580.37915742793
Medical : 85493.90586932447
Medical : 85407.6139380531
Medical : 85321.50276243094
Medical : 85235.57284768212
Medical : 85149.78831312018
Medical : 85064.19052863437
Medical : 84978.77667766776
Medical : 84893.52307692308
Medical : 84808.43139407245
Medical : 84723.51754385965
Medical : 84638.76341730558
Medical : 84554.10940919037
Medical : 84469.6306010929
Medical : 84385.27183406113
Medical : 84301.09705561613
Medical : 84217.08387799564
Medical : 84133.25027203483
Medical : 84049.55217391305
Medical : 83966.01194353963
Medical : 83882.62581344902
Medical : 83799.41061755146
Medical : 83716.3722943723
Medical : 83633.43783783783
Medical : 83550.65334773218
Medical : 83468.04207119741
Medical : 83385.59375
Medical : 83303.31001076427
Medical : 83221.17419354839
Medical : 83139.16648764769
Medical : 83057.32725321889
Medical : 82975.65380493033
Medical : 82894.1391862955
Medical : 82812.76898395721
Medical : 82731.56730769231
Medical : 82650.48132337247
Medical : 82569.51066098081
Medical : 82488.69755058573
Medical : 82408.05319148937
Medical : 82327.5738575983
Medical : 82247.26433121019
Medical : 82167.10604453871

You are iterating over all rows in the dataset first. That’s not what the instructions point out -

Loop over the unique genres of the App Store dataset

Your for loops are the opposite (interchanged) of what’s required, I believe.

hi,
I didn’t get the solution can you walk me through it.
genres_ios = freq_table(ios_final, -5)

for genre in genres_ios:
total = 0
len_genre = 0
for app in ios_final:
genre_app = app[-5]
if genre_app == genre:
n_ratings = float(app[5])
total += n_ratings
len_genre += 1
avg_n_ratings = total / len_genre
print(genre, ‘:’, avg_n_ratings)

  • Please make sure to format your code appropriately so that it’s readable.
  • In your original code you were using free_ios_apps. In your new code, you are using ios_final. Try to make sure that your ios_final is what’s expected as per the instructions as well.

Hello,

Duly noted. I will make sure henceforth to format my code. My question was:
Why is interchanging two for loops an issue? I am not getting that part still

My code:
prime_genre=freq_table(free_ios_apps,11)

total=0
len_genre=0
for each_row in free_ios_apps:
genre=each_row[11]

for genre in prime_genre:
    if genre in prime_genre:
        app=each_row[1]
        rating=float(each_row[5])
        len_genre+=1
        total+=rating

avg_app_genre=total/len_genre
  

print(genre,':',avg_app_genre)

Solution code:
genres_ios = freq_table(ios_final, -5)

for genre in genres_ios:
total = 0
len_genre = 0
for app in ios_final:
genre_app = app[-5]
if genre_app == genre:
n_ratings = float(app[5])
total += n_ratings
len_genre += 1
avg_n_ratings = total / len_genre
print(genre, ‘:’, avg_n_ratings)

I am really sorry for some reason the code I copied from solution notebook seems to lose it’s format for some reason