Understanding the Pandas IO API
Understanding the pandas IO API. Pandas IO Tools is the API that allows you to save the contents of
DataFrame objects to the clipboard, objects, or files of various types.
It also enables loading of data from the clipboard, objects, or files.
DataFrame objects have methods that enable writing data and labels to the clipboard or files. They’re named with the pattern
<file-type> is the type of the target file. You’ve already learned about
.to_excel(), but there are others, including
00:44 There are still more file types that you can write to, so this list is not exhaustive.
00:50 These methods have parameters specifying the target file path where you save the data and labels. This is mandatory in some cases and optional in others.
If this option is available and you choose to omit it, then the methods return the objects—like strings or iterables—with the contents of the
DataFrame instances. There are a few other parameters, but they’re mostly specific to one or several methods.
01:16 You won’t get into them in detail here.
pandas functions for reading the contents of files are named using the pattern
read_<file-type>(), where, again,
<file-type> indicates the type of the file to be read.
You’ve already seen the pandas
read_excel() functions, and these others follow the same pattern for the file types you’ll be covering in this course.
These functions have a parameter that specify the target file path. It can be any valid string that represents the path, either on a local machine or a URL, and it also accepts
01:52 There are other parameters, but they’re specific to one or several functions, and again, we won’t go into them in detail here.
02:00 So now that you’ve seen how the pandas IO API works, let’s get started by looking more closely at working with CSV files.
Become a Member to join the conversation.