Calculating Financial Ratios
123456789101112131415161718import 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"]])
1234567891011121314151617import 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)
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 2. Kapittel 2
Spør AI
Spør AI
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?
Fantastisk!
Completion rate forbedret til 7.14
Calculating Financial Ratios
Sveip for å vise menyen
123456789101112131415161718import 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"]])
1234567891011121314151617import 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)
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 2. Kapittel 2