Discover more from Daily Dose of Data Science
A Lesser-Known Feature of Apply Method In Pandas
After applying a method on a DataFrame, we often return multiple values as a tuple. This requires additional steps to project it back as separate columns.
Instead, with the result_type argument, you can control the shape and output type. As desired, the output can be either a DataFrame or a Series.
Share this post on LinkedIn: Post Link.
Thanks for reading Daily Dose of Data Science! Subscribe for free to receive new posts and support my work.
Find the code for my tips here: GitHub.