Daily Dose of Data Science

Share this post

A Lesser-Known Feature of Apply Method In Pandas

www.blog.dailydoseofds.com

A Lesser-Known Feature of Apply Method In Pandas

Avi Chawla
Dec 27, 2022
3
Share

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.

I like to explore, experiment and write about data science concepts and tools. You can read my articles on Medium. Also, you can connect with me on LinkedIn.

3
Share
Previous
Next
Comments
Top
New
Community

No posts

Ready for more?

© 2023 Avi Chawla
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing