March 2019
Intermediate to advanced
640 pages
23h 40m
English
Objectives
In this chapter, you’ll:
Understand the notions of files and persistent data.
Read, write and update files.
Read and write CSV files, a common format for machine-learning datasets.
Serialize objects into the JSON data-interchange format—commonly used to transmit over the Internet—and deserialize JSON into objects.
Use the with statement to ensure that resources are properly released, avoiding “resource leaks”.
Use the try statement to delimit code in which exceptions may occur and handle those exceptions with associated except clauses.
Use the try statement’s else clause to execute code when no exceptions occur in the try suite.
Use the try statement’s finally clause to execute code regardless of whether an ...
Read now
Unlock full access