You can generate a plot of hourly rides. You can learn to round time in Pandas DataFrame and use the “groupby” function to group rows at a given time and then count them. You can use Pandas plotting capabilities to display the result.
- [Instructor] Let's see which hours are more popular.…We're going to plug the number of…rides per hour on time axis.…To do this, we're going to use grouping.…If you're familiar with SQL,…you already know about grouping.…If not, you might want to check out our…SQL for data reporting and analysis crew.…Grouping is panda's equivalent of SQL's groupby.…The idea is to group data frame rows by a key.…In our example, we'd like to group rides by hour,…and then, sum the rides in a specific hour.…We're going to use round to round…the timestamp to the nearest hour.…
We'll use the pickup time as our ride time.…To access the timestamp object inside a series,…we have the .dt attribute,…very much like the .cat we saw earlier.…So, df, and we'll take the pickup daytime,…and we'll do head just to sort a few lines,….dt.round to H.…And we see now that the times are rounded…to the nearest hour.…Now we can generate the keys, and let's group.…When you group, you can either specify column…to group by its values, or provide a series,…which are the keys for each row.…
- Working with Jupyter notebooks
- Using code cells
- Extensions to the Python language
- Markdown cells
- Editing notebooks
- NumPy basics
- Broadcasting, array operations, and ufuncs
- Folium and Geo
- Machine learning with scikit-learn
- Plotting with matplotlib and bokeh
- Branching into Numba, Cython, deep learning, and NLP
Skill Level Intermediate
1. Scientific Python Overview
2. The Jupyter Notebook
3. NumPy Basics
Manage environments5m 11s
6. Folium and Geo
7. NY Taxi Data
10. Other Packages
11. Development Process
Next steps1m 33s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.