Going fast! #DataquestChallenge Premium Annual Offer:
500 get 50% & the next 1000 get 40% off.
GET OFFER CODE

Sharing my 2nd Guided Project: Exploring Hacker News

After a six-month hiatus, I finally got around to working on my 2nd Guided Project. I ended up developing this in PyCharm environment and then copied over the code into Juypter. Any comments are welcome!

Basics.ipynb (16.5 KB)

Click here to view the jupyter notebook file in a new tab

1 Like

Hi @lancy.yang

Thanks for sharing your second project with the community after such a long break. Have gone through the project and the general layout is well presented with well informing aim/objectives. Most of the code lines are well worked and has thus rendered good output, thumbs up mate for the good work.
Have got few suggestions;

  • Always consider re-running your project to have the sequential ordering of the cells.
  • Consider providing the links of the dataset you are using, for easy access by the reader.
  • You haven’t provided any comments at all in your workings.Remember comments somehow helps the reader to understand the code lines more so those that might appear complex.
  • Consider styling the text presented in the markdown cell, having the title in same font with the texts( the clarification given below the title) is not that good, you can read through this link for more clarifications.
  • Consider having subtopic in your workings.
  • Most of your outputs are overcrowded like in cell[6],consider spacing them up by using print("\n"). You can also have vertical display by performing for loop, and by this , they will be more readable.
  • Your workings shows that ‘Ask Post’ has ‘0.0’ average number of points per post, how then did you come to a conclusion that ‘Ask Post’ receive more comments compared to ‘Show Post’? Kindly check those workings in cell[16].

Otherwise , congratulations for having completed your second guided project .

Happy codding :grinning:

4 Likes

Thanks, @brayanopiyo18 for your thorough review! It is true I am out of practice with markdown cell formating, having been using a different IDE to write most of the code for this project. I need to practice that so thank you for the suggestion!

Regarding your last comment, I extended the project from counting comments to also calculating the points granted to the different types of posts. For comments, Ask Post receives on average 14.04 comments while the average number of comments for a Show Post is 10.32. Curiously, my calculation for Ask Posts’s averages # of points ended up something like 0.002294 so the conclusion is that Ask Post receives less points than Show Posts, but more comments than ‘Show Posts’. Does that make sense?

1 Like

Also I’m not sure how to do this. Is this doing a Cell–>run all?

1 Like

Thanks @lancy.yang for considering my suggestions.

lancy.yang
It is true I am out of practice with markdown cell formatting, having been using a different IDE to write most of the code for this project. I need to practice that so thank you for the suggestion!

It’s great to learn that you are out of practice with markdown cell formatting, you can check out this link as well , you will find a quick useful cheat sheet on Markdown syntax .

lancy.yang
Curiously, my calculation for Ask Posts ’s averages # of points ended up something like 0.002294 so the conclusion is that Ask Post receives less points than Show Posts, but more comments than ‘Show Posts’. Does that make?

Actually this very true, like average points is not that dependent on number of comments received , and you may end up with a post with less number points but with high number of comments on average. My worry is the ratio , like 0.002294 : 27.56 implies for every 1 point received in Ask Post , Show Post received like about 12,013 points . In many occasions, ask post received over 20 points, this then implies that most of number of points in show post is 240,000 which cannot output an average of 27.56.
So I checked through your code lines and I realized the mistake, In your workings , you did wrong addition assignment for the total points in ask post, the addition operator(+) followed the (=) operator which shouldn’t be the case that is,(+= is the correct assignment and not =+), and that’s why you ended up with a an average value of 0.00. Hope you will checked on that.

lancy.yang
Also I’m not sure how to do this. Is this doing a Cell–>run all ?

To re-run your project to achieve the sequential ordering, you click on the Kernel on the bar and you hove over to where it’s indicated Restart & Run All. I think the image below will do better;
Capture

2 Likes

Thanks for spotting that mistake @brayanopiyo18! I went back and check on it and see that yes indeed I wrote =+ instead of =+ so the expression ended up assigning the value of the num_points in the last row to total_points_askpost. Very happy that you caught that - made the poor assumption that maybe the points were not usually given to ask posts, and didn’t do a simple check on the data. Next time I see something where the numbers don’t seem to add up, I’ll definitely go back to my code, my assumptions. Thanks again, mate!

1 Like

That’s great @lancy.yang and all the best in your upcoming projects.

Happy codding :grinning:

1 Like