Exploring Hacker News Posts

Hacker News is a site started by the startup incubator Y Combinator, where user-submitted stories (known as "posts") receive votes and comments, similar to reddit. There are two types of posts in Hacker New with titles that begin with either Ask HN or Show HN.

Examples of Ask HN posts:

  1. Ask HN: How to improve my personal website?
  2. Ask HN: Am I the only one outraged by Twitter shutting down share counts?
  3. Ask HN: Aby recent changes to CSS that broke mobile?

Examples of Show HN posts:

  1. Show HN: Wio Link ESP8266 Based Web of Things Hardware Development Platform'
  2. Show HN: Something pointless I made
  3. Show HN: Shanhu.io, a programming playground powered by e8vm

This analysis will compare these two types of posts to determine the followings:

  1. Do Ask HN or Show HN receive more comments on average?
  2. Do posts created at a certain time receive more comments on average?

The link of Hacker News Posts dataset is here: https://www.kaggle.com/hacker-news/hacker-news-posts

Below are descirptions of the columns:

  1. id: the unique identifier from Hacker News for the post
  2. title: the title of the post
  3. url: the URL that the posts links to, if the post has a URL
  4. num_points: the number of points the post acquired, calculated as the total number of upvotes minus the total number of downvotes
  5. num_comments: the number of comments on the post
  6. author: the username of the person who submitted the post
  7. created_at: the date and time of the post's submission

Exploration of the Dataset

Explore Ask HN and Show HN Posts

Determine Average Number of Comments

Next, let's determine if ask posts or show posts receive more comments on average.

Compare the total and average number of two types of posts, Ask HN posts receive more comments on total and average.

Determine if Ask HN Posts Created At a Certain Time

Next, we'll determine if ask posts created at a certain time are more likely to attract comments. We'll use the following steps to perform this analysis:

  1. Calculate the number of ask posts created in each hour of the day, along with the number of comments received.
  2. Calculate the average number of comments ask posts receive by hour created.

Calculate Number of Ask HN Posts Creted per Hour & Number of Comments Received

Calculate Average Number of Ask HN Posts Created per Hour

Let's finish by sorting the list of lists and printing the five highest values in a format that's easier to read.

Conclusion

In our analysis, the best hour in which have a highest chance of receiving comments is posting Ask HN post at 3:00 PM EST.