Ratios from the income statement and balance sheet

Analyzing Financial Statements in Python

Rohan Chatterjee

Risk modeler

Asset turnover ratio

  • Ratio of revenue to assets
  • Measures how efficiently a company is using its assets to generate revenue

Formula:

$$\dfrac{\text{Total Revenue}}{\text{Total Assets}}$$

Analyzing Financial Statements in Python

Computing asset turnover ratio using pandas

merged_dat = pd.merge(income_statement, balance_sheet, on = ["Year", "company"])
  • merged_dat can now be used to compute the ratio and add it as another column in the DataFrame
merged_dat["asset_turnover"] = merged_dat["Total Revenue"] / merged_dat["Total Assets"]
Analyzing Financial Statements in Python

User-defined functions to compute ratios

  • Creating the columns below can become repetitive
balance_sheet["current_ratio"] = balance_sheet["Total Current Assets"] / balance_sheet["Total Current Liabilities"]

balance_sheet["debt_to_equity"] = balance_sheet["Total Liab"] / balance_sheet["Total Stockholder Equity"]
  • To avoid having to type this code again and again, we can package this into a user-defined function
Analyzing Financial Statements in Python

User-defined functions to compute ratios

def compute_ratio(df, numerator, denominator, ratio_name):
      df[ratio_name] = df[numerator]/df[denominator]
      return df

Compute the current ratio and debt-to equity ratio from the DataFrame balance_sheet using compute_ratio:

balance_sheet = compute_ratio(balance_sheet, "Total Current Assets",
                        "Total Current Liabilities", "current_ratio")
balance_sheet = compute_ratio(balance_sheet, "Total Liab",
                        "Total Stockholder Equity", "debt_to_equity")
Analyzing Financial Statements in Python

User-defined functions to compute ratios

  • Define the numerators, denominators and the ratio names in separate lists:
    list_of_numerators = ["Total Current Assets", "Total Liab"]            
    list_of_denominators = ["Total Current Liabilities", 
                          "Total Stockholder Equity"]
    list_of_ratio_names = ["current_ratio", "debt_to_equity"]
    
  • Loop over the lists and call the function compute_ratio:

    for numerator, denominator, ratio_name in zip(list_of_numerators,
                                                  list_of_denominators,
                                                  list_of_ratio_names):
    
        balance_sheet = compute_ratio(balance_sheet, 
                numerator,
                denominator, 
                ratio_name)
    
Analyzing Financial Statements in Python

Let's practice!

Analyzing Financial Statements in Python

Preparing Video For Download...