List Comprehensions and Lambda Functions
In this mission, you'll learn about lambda functions and list comprehensions, two techniques you can use to turbo-charge your data cleaning in Python.
json library in Python. This library has built-in functions that make it easy to work with JSON data using Python code.
As you work with this JSON data, you will also learn about list comprehensions and how they can be used to clean up your code and make it easier to read. A list comprehension can be used to do things like iterate over values in a list, perform a transformation on those values, and assign the result to a new list all on one line of code! After you learn about list comprehensions, you will learn about lambda functions: temporary functions that can also be declared in a single line of code to save time.
In this mission, you will continue working with data from Hacker News as you practice using regular expressions and apply your new skills with list comprehensions and lambda functions. By the end of this mission, you'll be comfortable working with JSON data, and using list comprehensions and lambda functions to speed up your data cleaning.
1. The JSON Format
2. Reading a JSON file
3. Deleting Dictionary Keys
4. Writing List Comprehensions
5. Using List Comprehensions to Transform and Create Lists
6. Using List Comprehensions to Reduce a List
7. Passing Functions as Arguments
8. Lambda Functions
9. Using Lambda Functions to Analyze JSON data
10. Reading JSON files into pandas
11. Exploring Tags Using the Apply Function
12. Extracting Tags Using Apply with a Lambda Function
13. Next Steps