Chapter 12. Input and Output

In this chapter, we will cover some options for handling data files. Depending on the data and the desired format, there are several options for reading and writing. We will show some of the most useful alternatives.

File handling

File I/O (input and output) is essential in a number of scenarios. For example:

  • Working with measured or scanned data. Measurements are stored in files that need to be read to be analyzed.
  • Interacting with other programs. Save results to files so that they can be imported in other applications, and vice-versa.
  • Storing information for future reference or comparisons.
  • Sharing data and results with others, possibly on other platforms using other software.

In this section, we will cover how to handle ...

Get Scientific Computing with Python 3 now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.