Menu
Stuff by Yuki
  • Home
  • Data Engineering
    • Python
  • Business Intelligence
    • Power BI
    • Tableau
  • Perspectives
  • About
  • Contact
Stuff by Yuki

Python Pandas .apply() function – how does it differ from .applymap() and .map()?

Posted on November 18, 2021November 19, 2021

Pandas has a few functions that work very similarly, which are .apply(), .applymap(), and .map().

Here is a simple explanation:

.map() and .applymap() are similar to .apply(), but .map() only works on Series and .applymap() only works on Dataframes. So I’d usually go ahead and use .apply() than these other two functions

I used .apply() for this small project as part of the on-going community project Prepping data.

I’d probably prefer using .apply() in most cases since it covers both Series and Dataframes.

Anyways, this was just a little introduction to .apply(), .applymap(), and .map() 🙂 Hope this helps!

Source code in my Github repo

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Where I’m Headed in the Next 5 Years
  • Open-Source vs Vendor Data Tools
  • Developing the Habit of Writing
  • How to Inspect and Optimize Query Plans in Python Polars
  • Learn Python Polars with Polars Cookbook

Popular Posts

  • A Running Total Calculation with Quick Measure in Power BI
  • A Complete Guide to Git Integration in Power BI
  • How To Copy And Paste Report Page in Power BI
  • Handling Missing Values in Polars
  • How to Convert String to Date or Datetime in Polars

connect with me

  • LinkedIn
  • Twitter
  • Github
  • Website

Search Articles

©2025 Stuff by Yuki | Powered by SuperbThemes