How it works...
It can get tedious to repeatedly write the read_csv function when importing many DataFrames at the same time. One way to automate this process is to put all the file names in a list and iterate through them with a for loop. This was done in step 1 with a list comprehension.
The rest of this step builds a function to display multiple DataFrames on the same line of output in a Jupyter notebook. All DataFrames have a to_html method, which returns a raw HTML string representation of the table. The CSS (cascading style sheet) of each table is changed by altering the display attribute to inline so that elements get displayed horizontally next to one another rather than vertically. To properly render the table in the notebook, you ...
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