In this section, you continued to build your Python skills. As you continue your Data Science journey, programming will continue to be one of the most important components of your toolkit.
- Functions and Methods - Python has a range of functions and methods (methods are functions associated with an object) that can help us to perform a wide range of useful tasks quickly and efficiently.
- Loops - Loops aren't only for collections.
while
loops allow us to iterate until a condition is met, and we can use nested loops for more complicated situations (but should be careful about doing so too often). - Custom Functions - When you write a piece of code that you might want to use again, it often makes sense to save it in as a function, and you can add arguments to functions to allow them to be more flexible in the ways they're reused.
- Measures of Centrality - There are three common ways to measure the "central tendency" of a dataset - the mean, the median, and the mode. Each can be used to answer different questions and has strengths or weaknesses that depend on how the data is distributed.
- Measures of Dispersion - There are multiple measures of dispersion. The absolute deviation, variance, standard deviation, and interquartile range can all give us a sense of how closely or widely a dataset is distributed from its central value. Again, this is going to be useful later in the course.
Great job! In this section, we spent time deepening our Python skills and introduced some basic statistics that will be important as we work with various types of datasets later in the course.