Chapter 10. Input/Output Operations
Financial analytics always starts and ends with data on disk. Prices, orders, risk reports, and simulation results need to be loaded from files, transformed in memory, and written back to storage so that other systems and people can work with them. This chapter shows how to perform these input/output (I/O) tasks efficiently and reliably with the Python standard library, NumPy, and pandas.
The chapter focuses on practical file-based workflows for financial data. It shows how
to write and read text files and serialized Python objects, store numerical arrays
efficiently with NumPy, use pandas for CSV, SQL, JSON, and HDF5 I/O, and structure
examples so that they can later be measured with tools such as %timeit in a notebook.
To follow along, you need a working Python environment with numpy, pandas, and
matplotlib installed, basic familiarity with Path from the pathlib module and with
Series and DataFrame objects, and read access to data/eod_data.csv or its ...
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