Session Ready
Exercise

Tesla income statement

The dataset for the Tesla income statement is called income_statement.

This dataset has a final column called Trailing Twelve Months (TTM), which is the most recent 12 months of data available. We will use this to calculate a 2018 forecast for Tesla.

We are only interested in the rows 'Revenue', 'Gross profit', 'Total operating expenses', and 'Net income', so we'll create a filtered income statement to only show these rows. The filtering code uses the following pattern.

dataframe[dataframe.columnname.isin(list_of_categories)]
Instructions
100 XP
  • Look at income_statement in the shell.
  • Create a list called interesting_metrics that contains the rows we are interested in as a list.
  • Use the .isin() method to filter the income statement for rows where metric is in interesting_metrics.
  • Look at the result.