7
Reshaping DataFrames
Working with data is hard. Rarely, if ever, can you just collect data and have it immediately yield insights. Often, significant time and effort must be put into cleansing, transforming, and reshaping your data to get it into a format that is usable, digestible, and/or understandable.
Is your source data a collection of CSV files, where each file represents a different day? Proper use of pd.concat will help you take those files and combine them into one with ease.
Does the relational database you use as a source store data in a normalized form, while the target columnar database would prefer to ingest data all in one table? pd.merge can help you combine your data together.
What if your boss asks you to take millions of ...
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