Inflation in the Car Market (5-6/8)

Setup Notebook for Plots in Callisto Jupyter Notebooks

Welcome back Data Science Adventurers!

In the last part of the Car Prices Project, we established a path of exploration to look at supply and demand data for the auto industry. In this part, we will execute our plan!

There’s some setup we need to do. We made a really useful `chart(id)` function that will do all the tedious work for us. All it will need are the IDs for the data to download and plot. While that can get cumbersome (to look at weird IDs like `CP0711EZ18M086NEST`), Callisto makes it super easy to work with data. We’re going to export our auto_search DataFrame that has all the IDs into a CSV file. We can copy and paste the IDs from it as needed for the chart function.

We will be using the Data Explorer in Callisto. To follow along, make sure you have followed the previous steps up to creating the `chart(id)` function. You should also have an `auto_search` DataFrame.

Open the Data Explorer again by clicking on the `Data Explorer` button on the top right. You should see “auto_search” in your list.

In Callisto, you can export data from the data explorer!

See that “CSV” icon on the top right of the Data explorer window?

Click it to save the “auto_search” DataFrame into a file. Make sure to save it in the same location as the current notebook. See where the current notebook is, click the “…” button in the Files, then do “Show in Finder”

Open the `auto_search` file with the Numbers app or Microsoft Excel. Pick out an ID to try for the chart function. I picked the “TOTALSA” for Auto Sales data.

In a new cell run the following:

auto_sales = chart("TOTALSA", auto_search)

You should see a plot like this

If you’ve made it this far, there’s only one more thing left to do before we plot everything — get our cells ready.

Managing Cells in Callisto

Paste the following in a new cell

# 1. Auto Sales - Demand
# 2. Auto Inventory — Supply
# 3. Auto Production and Manufacturing - Supply
# 4. Producer Price Index for making New Vehicles — see what the bottleneck is
# 5. Reasons behind the bottleneck - Raw Materials

Now put the cursor at the end of each line and go over to the “…” button on the right side of the cell. Then click “Split at Cursor”. That should split the cell into two. The first one is with items # 1 and the second one is #2 to #5.

After the first split, it should look like:

Do the same for each item. Next would be putting the cursor at the end of `# 2. Auto inventory — Supply` and perform “Split At Cursor”. After splitting all 5 lines, you should have 5 separate cells, each with a description of what we will chart in the cell.

There it is! We’re done with the setup! Now we just need to look for the IDs we want for each of these and chart.

What’s Next?

Use our amazing chart function!

The next part will be plotting the different trends in the car industry. We might get to the bottom of the entire car industry in this project!

1 This statement has not been evaluated by the Food and Drug Administration. This product is not intended to diagnose, treat, cure, or prevent any economic disease.