In this video, we're going to look at how to manage data using API's in Python.
Hi, my name is Art, and in this video I'm going to show you how to read data from APIs and convert that data into a Python data structure such as a Pandas DataFrame.
To use Pandas, you need to import it: `import pandas as pd`.
You also need to import the Requests Library, which helps Python to get online and send requests to a server for data. Most APIs require registration and sometimes require a credit card. To avoid this, we can use the Rick and Morty API which is free.
We can then grab the values we want, such as `name`, `status`, and `species`, and use dictionary notation to get them. Now we can initialize the DataFrame and use `pd.json_normalize()` to convert the data into a DataFrame. We can assign it to a variable called `df` and then do something else with it, such as writing it into a text file or a SQL database.