Skip to main content

Python Data Science Toolbox (Part 1)

Learn the art of writing your own functions in Python, as well as key concepts like scoping and error handling.

Start Course for Free
3 Hours12 Videos46 Exercises314,204 Learners3650 XPData Scientist TrackPython Fundamentals TrackPython Programmer Track

Create Your Free Account



By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA. You confirm you are at least 16 years old (13 if you are an authorized Classrooms user).

Loved by learners at thousands of companies

Course Description

It's time to push forward and develop your Python chops even further. There are tons of fantastic functions in Python and its library ecosystem. However, as a data scientist, you'll constantly need to write your own functions to solve problems that are dictated by your data. You will learn the art of function writing in this first Python Data Science Toolbox course. You'll come out of this course being able to write your very own custom functions, complete with multiple parameters and multiple return values, along with default arguments and variable-length arguments. You'll gain insight into scoping in Python and be able to write lambda functions and handle errors in your function writing practice. And you'll wrap up each chapter by using your new skills to write functions that analyze Twitter DataFrames.

  1. 1

    Writing your own functions


    In this chapter, you'll learn how to write simple functions, as well as functions that accept multiple arguments and return multiple values. You'll also have the opportunity to apply these new skills to questions commonly encountered by data scientists.

    Play Chapter Now
    User-defined functions
    50 xp
    Strings in Python
    50 xp
    Recapping built-in functions
    50 xp
    Write a simple function
    100 xp
    Single-parameter functions
    100 xp
    Functions that return single values
    100 xp
    Multiple parameters and return values
    50 xp
    Functions with multiple parameters
    100 xp
    A brief introduction to tuples
    100 xp
    Functions that return multiple values
    100 xp
    Bringing it all together
    50 xp
    Bringing it all together (1)
    100 xp
    Bringing it all together (2)
    100 xp
    50 xp

In the following tracks

Data Scientist Python FundamentalsPython Programmer




fgcastroFrancisco Castro


Intermediate Python
Hugo Bowne-Anderson Headshot

Hugo Bowne-Anderson

Data Scientist at DataCamp

Hugo is a data scientist, educator, writer and podcaster at DataCamp. His main interests are promoting data & AI literacy, helping to spread data skills through organizations and society and doing amateur stand up comedy in NYC. If you want to know what he likes to talk about, definitely check out DataFramed, the DataCamp podcast, which he hosts and produces:
See More

What do other learners have to say?

I've used other sites—Coursera, Udacity, things like that—but DataCamp's been the one that I've stuck with.

Devon Edwards Joseph
Lloyds Banking Group

DataCamp is the top resource I recommend for learning data science.

Louis Maiden
Harvard Business School

DataCamp is by far my favorite website to learn from.

Ronald Bowers
Decision Science Analytics, USAA