Skip to main content

Command Palette

Search for a command to run...

Partial functions in Python

Updated
1 min read
Partial functions in Python
C

Senior Data Engineer • Contractor / Freelancer • GCP & AWS Certified

Have you ever used partial functions? It's an interesting functionality that can be found in the functools package.

It's pretty straightforward - you can take a function that takes multiple arguments and produces a new function that has one or more arguments already set, effectively tailoring your previous function to a specific need.

See below an example of it in action.

Found it useful? Subscribe to my Analytics newsletter at notjustsql.com.


Enjoyed this? Here are some related articles you might find useful:

More from this blog

D

Datawise — SQL, BigQuery & Python for Data Engineers

205 posts

Data Engineer with a passion for transforming complex data landscapes into insightful stories. Here on my blog, I share insights, challenges, and the ever-evolving dance of technology and business.