Abstract
Apply is one of the most incorrectly used functions in pandas. Chances are if you are using it, you shouldn’t be. This is because Apply “applies” the function to each row or each column in the data set effectively breaking one of the cardinal rules of using pandas: do not iterate over the data set. In this chapter, we’ll explore when Apply is the right choice and present alternative solutions for when it’s not.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2020 Hannah Stepanek
About this chapter
Cite this chapter
Stepanek, H. (2020). The apply Method. In: Thinking in Pandas. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5839-2_6
Download citation
DOI: https://doi.org/10.1007/978-1-4842-5839-2_6
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-5838-5
Online ISBN: 978-1-4842-5839-2
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)