From the course: Advanced Python: Working With Data
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Deserialization of data - Python Tutorial
From the course: Advanced Python: Working With Data
Deserialization of data
- [Instructor] Now that we've seen how to save data to a csv file, in this example, we're going to do the opposite. We're going to load information from an existing csv file into a json structure. And this process is sometimes called deserialization. We're going to use one of the CSV files that was created in an earlier exercise. So if you haven't already done the exercise where we save data to a csv file, go back and do it now, so you'll have the file to work on in this example. So here I have the output from the previous exercise called largequakes.csv. So let's view that file again, and inside, remember, there's four columns of data, right? There's the name of the place, the magnitude, date and the link to the event on the usgs website. So we're going to use the same csv module to read this data as we use to write the data in the first place. So let's open up the deserialize code, and what we're going to do, you can see in…