Hi i am afraid i am not getting the right Average number of posts. Also doesn’t appear to have any patterns on the average number of posts, or am i missing something out?
in this link here,
https://app.dataquest.io/m/356/guided-project%3A-exploring-hacker-news-posts/7/sorting-and-printing-values-from-a-list-of-lists
the average number of posts is shown like the below
[
[‘09’, 5.5777777777777775],
[‘13’, 14.741176470588234],
[‘10’, 13.440677966101696],
[‘14’, 13.233644859813085],
[‘16’, 16.796296296296298],
[‘23’, 7.985294117647059],
[‘12’, 9.41095890410959],
[‘17’, 11.46],
[‘15’, 38.5948275862069],
[‘21’, 16.009174311926607],
[‘20’, 21.525],
[‘02’, 23.810344827586206],
[‘18’, 13.20183486238532],
[‘03’, 7.796296296296297],
[‘05’, 10.08695652173913],
[‘19’, 10.8],
[‘01’, 11.383333333333333],
[‘22’, 6.746478873239437],
[‘08’, 10.25],
[‘04’, 7.170212765957447],
[‘00’, 8.127272727272727],
[‘06’, 9.022727272727273],
[‘07’, 7.852941176470588],
[‘11’, 11.051724137931034]
]
however, what i get is
[[‘21’, 7.339449541284404],
[‘15’, 0.8620689655172413],
[‘07’, 2.941176470588235],
[‘05’, 4.3478260869565215],
[‘18’, 182.56880733944953],
[‘17’, 5.0],
[‘13’, 15.294117647058824],
[‘09’, 4.444444444444445],
[‘20’, 11.25],
[‘08’, 4.166666666666666],
[‘02’, 10.344827586206897],
[‘00’, 27.27272727272727],
[‘04’, 4.25531914893617],
[‘12’, 4.10958904109589],
[‘14’, 16.822429906542055],
[‘23’, 2.941176470588235],
[‘03’, 1.8518518518518516],
[‘22’, 1.4084507042253522],
[‘11’, 50.0],
[‘16’, 1.8518518518518516],
[‘06’, 50.0],
[‘19’, 1.8181818181818181],
[‘01’, 6.666666666666667],
[‘10’, 1.694915254237288]]
i think it may be due to my calculation of Average
avg_by_hour =
for row in counts_by_hour: temp_comments = [] hour = row no_posts = counts_by_hour[row] no_comments = comments_by_hour[row] avg_hour = int(no_comments)/int(no_posts) temp_comments = [hour,100*avg_hour] avg_by_hour.append(temp_comments)
However, when i look at the the previous Number of Posts and Number of Comments, it also looks like there is no discernible pattern there?
even if i were to discount the absolute numbers, i can see that the hours of where the peak is for the Guide and mine differs at different point.
Anyone else facing the same problem as i do?
Guided Project Exploring Hacker News Posts.ipynb (20.9 KB)