In this video, learn how to plot map data on top of images using the matplotlib library.
- [Instructor] Let's move on to our second matplotlib feat.…Plotting Curiosity's progress…on a map of the Martian surface.…I begin as usual…by importing all the packages that we use in this chapter.…We need to find out the position of the rover…as a functional Martian day.…A little digging shows that NASA publishes such a database.…And I have included it in your exercise files.…It's XML though.…The somewhat pedantic, extensible mark-up language.…And it's a long file.…
Let's look at the beginning.…Simple enough.…It's a sequence of location elements…each describing a site…providing a starting and ending sol.…As well as a latitude and longitude.…Luckily, Beautiful Soup can handle XML…just as well as HTML.…We just need to specify a different parser.…We feed a file object, open for reading to Beautiful Soup.…And we specify the LXML/XML parser.…
Next we can get all locations.…There are 14,000 of them.…We collect the site coordinates…in a dictionary index by the site,…so we don't have to worry about duplicates.…What's the appropriate kind of dictionary?…
- Designing efficient loops
- Exploiting Python collections
- Writing Pythonic code
- Choosing the best libraries for your tasks
- Downloading webpages with requests
- Parsing HTML with Beautiful Soup
- Manipulating images with Pillow
- Making videos and drawing on maps with matplotlib
- Serving webpages with Jinja2 and Flask
- Working with Python classes
- Taking advantage of functional techniques
- Profiling CPU and memory use
- Exploiting parallelism
Skill Level Intermediate
1. Installation and Setup
Jupyter notebooks3m 19s
2. Writing Python Efficiently
3. Exploiting Python Libraries
4. Advanced: Python Object-Oriented and Functional Programming
5. Introduction to Performance Optimization in Python
Next steps1m 2s
- 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.