Intro to Python for Computer Science and Data Science: Learning to Program with AI, Big Data and The Cloud
by Paul J. Deitel, Harvey M. Deitel
9.1 Introduction
Variables, lists, tuples, dictionaries, sets, arrays, pandas Series and pandas DataFrames offer only temporary data storage. The data is lost when a local variable “goes out of scope” or when the program terminates. Files provide long-term retention of typically large amounts of data, even after the program that created the data terminates, so data maintained in files is persistent. Computers store files on secondary storage devices, including solid-state drives, hard disks and more. In this chapter, we explain how Python programs create, update and process data files.
We consider text files in several popular formats—plain text, JSON (JavaScript Object Notation) and CSV (comma-separated values). We’ll use JSON to serialize ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access