Skip to Content
Pandas for Everyone: Python Data Analysis, First Edition
book

Pandas for Everyone: Python Data Analysis, First Edition

by Daniel Y. Chen
December 2017
Beginner to intermediate
410 pages
12h 45m
English
Addison-Wesley Professional
Content preview from Pandas for Everyone: Python Data Analysis, First Edition

O. Functions

Functions are one of the cornerstones of programming. They provide a way to reuse code. If you’ve ever copy-pasted lines of code just to change a few parameters, then turning those lines of code into a function not only makes your code more readable, but also prevents you from making mistakes later on. Every time code is copy-pasted, it adds another place to look if a correction is needed, and puts that burden on the programmer. When you use a function, you need to make a correction only once, and it will be applied every time the function is called.

I highly suggest the Software-Carpentry Python episode on functions for more details.1

1. http://swcarpentry.github.io/python-novice-inflammation/06-func/

An empty function looks like ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pandas for Everyone: Python Data Analysis, 2nd Edition

Pandas for Everyone: Python Data Analysis, 2nd Edition

Daniel Y. Chen

Publisher Resources

ISBN: 9780134547046Purchase book