Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Calculating Financial Ratios | Analyzing Financial Data
Python for Accountants

bookCalculating Financial Ratios

123456789101112131415161718
import pandas as pd # Example financial statement data data = { "Revenue": [200000, 150000, 180000], "Cost_of_Goods_Sold": [120000, 90000, 110000], "Current_Assets": [80000, 70000, 90000], "Current_Liabilities": [40000, 35000, 45000] } df = pd.DataFrame(data) # Calculate gross margin df["Gross_Margin"] = (df["Revenue"] - df["Cost_of_Goods_Sold"]) / df["Revenue"] # Calculate current ratio df["Current_Ratio"] = df["Current_Assets"] / df["Current_Liabilities"] print(df[["Gross_Margin", "Current_Ratio"]])
copy
1234567891011121314151617
import pandas as pd # Sample DataFrame with financial data df = pd.DataFrame({ "Revenue": [300000, 250000], "Cost_of_Goods_Sold": [180000, 150000], "Current_Assets": [120000, 100000], "Current_Liabilities": [60000, 50000] }) # Add Gross Margin Ratio column df["Gross_Margin"] = (df["Revenue"] - df["Cost_of_Goods_Sold"]) / df["Revenue"] # Add Current Ratio column df["Current_Ratio"] = df["Current_Assets"] / df["Current_Liabilities"] print(df)
copy
question mark

Select the correct answer

question mark

Select the correct answer

question-icon
Revenue Cost_of_Goods_Sold Gross_Margin
0 100000 60000 0.40
1 200000 120000 0.40

Click or drag`n`drop items and fill in the blanks

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 2

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

Suggested prompts:

Can you explain what the gross margin and current ratio values mean in this context?

How can I interpret these ratios to assess a company's financial health?

Are there other important financial ratios I should consider analyzing?

bookCalculating Financial Ratios

Sveip for å vise menyen

123456789101112131415161718
import pandas as pd # Example financial statement data data = { "Revenue": [200000, 150000, 180000], "Cost_of_Goods_Sold": [120000, 90000, 110000], "Current_Assets": [80000, 70000, 90000], "Current_Liabilities": [40000, 35000, 45000] } df = pd.DataFrame(data) # Calculate gross margin df["Gross_Margin"] = (df["Revenue"] - df["Cost_of_Goods_Sold"]) / df["Revenue"] # Calculate current ratio df["Current_Ratio"] = df["Current_Assets"] / df["Current_Liabilities"] print(df[["Gross_Margin", "Current_Ratio"]])
copy
1234567891011121314151617
import pandas as pd # Sample DataFrame with financial data df = pd.DataFrame({ "Revenue": [300000, 250000], "Cost_of_Goods_Sold": [180000, 150000], "Current_Assets": [120000, 100000], "Current_Liabilities": [60000, 50000] }) # Add Gross Margin Ratio column df["Gross_Margin"] = (df["Revenue"] - df["Cost_of_Goods_Sold"]) / df["Revenue"] # Add Current Ratio column df["Current_Ratio"] = df["Current_Assets"] / df["Current_Liabilities"] print(df)
copy
question mark

Select the correct answer

question mark

Select the correct answer

question-icon
Revenue Cost_of_Goods_Sold Gross_Margin
0 100000 60000 0.40
1 200000 120000 0.40

Click or drag`n`drop items and fill in the blanks

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 2
some-alt