Unit 37Taming Pandas File I/O

If you had no other reason to use pandas, you might still succumb to its mastery of file input and output. pandas input/output facilities enable data exchange between frames and series on one hand, and CSV files, tabular files, fixed-width files, JSON files (earlier discussed here), the operating system clipboard, and so on, on the other hand. Among other things, pandas supports:

  • Automatic indexing and column names extraction

  • Data type inference, data conversion, and missing data detection

  • Datetime parsing

  • The elimination of “unclean” data (skipping rows, footers, and comments; treating thousands’ separators)

  • Data chunking

Reading CSV and Tabular Files

The read_csv function reads a frame from a CSV file designated ...

Get Data Science Essentials in Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.