Guided Project: Traffic FLow analysis on the I-19

Hi all,
I have shared my guided project, I would like to know how did I do here. your feedback will help me improve my learning skills more.

Thanks all,
Shahzaib Saleem

(Learn data science with Python and R projects)

Basics.ipynb (326.0 KB)

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

@shahzaibsaleem665 congrats :handshake: on completing your project.

I have a few pointers that hopefully help in improving the same in the next iteration. (please click on each bullet point triangle to open the list of my suggestions).

Presentation Style
  • Ensure to re-run the entire project after you are done completing one. This is how to do it image
  • Some of your visualizations are missing titles e.g. those after cell[7], cell[9] etc.
  • You seem to have a couple of SettingWithCopyWarning. I recommend you read this article in DQ. I know it is a long read, but I guarantee that it is worth it because you are going to encounter this issue quite often.
  • Include an introduction which provides an understanding of the dataset and a link to access the data set. This adds credibility to your project.
  • I recommend that you include a Conclusion section that summarizes all your findings. This adds credibility to you as an analyst since that is what is expected from you.
  • I would also add that it is best to divide your project in to multiple sections besides Introduction and Conclusion. Like Reading the Data, Analysing Day time data etc. This helps with the story telling, similar to how you have chapters in a book.
  • For each of the plot associated to day and night or business days and weekdays, I recommend the use of different colors. Having the same color scheme throughout can be confusing to some readers. The same is recommended for when you discuss weather elements after cell [69] and cell [75]
  • Ensure to add more explanations after each plot. Include such things as what you deduce after looking at the plot and maybe include some research that helps to validate the plot itself.
Coding Style
  • I would recommend the addition of comments alongside your code to help when you re-visit the project. The comments act as bookmarks to your memory when you plan to re-do it.
Bugs/Inaccuracies
  • I didn’t go through the code at great depth, but most of your outputs seem correct, so you should be in the right there.
  • There are a few grammatical and spelling related errors which you should keep a lookout for in your final iteration.
Miscellaneous
  • There are a few challenge questions at the end of the project, I recommend that you give those a shot. Those will help to differentiate your project and make them stand out.

Keep the fire :fire: going, and before you know it, you’ll up and away :rocket: Good luck and hope to see more projects soon!

Thanks for your feedback. I will definitely keep the things mentioned above in mind while working on next project.

Why the night_time is:
night_time = traffic_flow[(traffic_flow[‘date_time’].dt.hour >= 19) & (traffic_flow[‘date_time’].dt.hour <= 23)]

but not:
night_time = traffic_flow[(traffic_flow[‘date_time’].dt.hour >= 19) | (traffic_flow[‘date_time’].dt.hour <7)]

I have seen a lot of people showing the “night_time” is the second one. I do not understand that why it is “or |” but not “and &”.

Hope anyone can answer the question.

Thank you.

Hi there @g.ymsiliusu . I wanted to take some moments to clarify this for you :+1:

Nighttime was considered to be the time that most people would naturally be in bed sleeping. This will generally include:

  1. The late evening hours from 7pm to 11pm (19:00 - 23:00) :sleeping_bed:
  2. The early hours of the morning (12am - 6am) or 00:00 - 06:00 hours when most people are still likely to be in bed :zzz: :bed:.

Lets examine the code. I will start with the OR one

night_time = traffic_flow[(traffic_flow[‘date_time’].dt.hour >= 19) | (traffic_flow[‘date_time’].dt.hour <7)]

This code is accounting for hours that are either in the late evening ( greater 19:00 hours) OR hours in the early morning (lesser than 07:00 hrs). This ensures that you are able to select nightime hours between dusk and dawn.

Now Lets examine the other code:

night_time = traffic_flow[(traffic_flow[‘date_time’].dt.hour >= 19) & (traffic_flow[‘date_time’].dt.hour <= 23)]

You will notice that the code above only evaluates one part of our nighttime criteria. It selects hours between 7pm AND 11pm in the evening then stops there. The challenge with this particular code is that it will not account for those early hours of the morning that we also need in our analysis (00:00 - 06:00 hrs).

I hope this helps :slightly_smiling_face:

It is a well-written project. I suggest you must always try using subheadings as well as markdown cells to explain your codes in order to help the leaders understand what you are doing.