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 rows of data and, from that, produce a nice summary report that anyone in the business can understand? pd.pivot_table
is the right tool for the job here, allowing you to quickly and easily summarize your data.
Ultimately, the reasons...