0% found this document useful (0 votes)
7 views1 page

Profit and Loss Codee

The document contains a Python script that analyzes a profit and loss statement for the year 2024 using Matplotlib for visualization. It calculates Profit Before Tax and Profit for the Year based on various income and expense categories, and then generates a horizontal bar chart to display these financial figures. The chart includes annotations for each bar to show the exact values in thousands.

Uploaded by

vijayajose110581
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Profit and Loss Codee

The document contains a Python script that analyzes a profit and loss statement for the year 2024 using Matplotlib for visualization. It calculates Profit Before Tax and Profit for the Year based on various income and expense categories, and then generates a horizontal bar chart to display these financial figures. The chart includes annotations for each bar to show the exact values in thousands.

Uploaded by

vijayajose110581
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

29/01/2025, 23:19 Untitled6.

ipynb - Colab

import matplotlib.pyplot as plt

# Data from the profit and loss statement


categories = [
'Value of Sales', 'Income from Services', 'GST Recovered', 'Other Income',
'Cost of Materials Consumed', 'Purchase of Stock-in-Trade',
'Changes in Inventories', 'Excise Duty', 'Employee Benefits Expense',
'Finance Costs', 'Depreciation / Amortisation', 'Other Expenses',
'Current Tax', 'Deferred Tax'
]

values = [
533566, 41390, -27014, 12128, -376418, -13453, -2700, -13408, -7807,
-13430, -17690, -59891, -10922, -2309
]

# Calculate Profit Before Tax


profit_before_tax = sum(values[:4]) - sum(values[4:12])
values.append(profit_before_tax)
categories.append('Profit Before Tax')

# Calculate Profit for the Year


profit_for_year = profit_before_tax - sum(values[12:14])
values.append(profit_for_year)
categories.append('Profit for the Year')

# Plotting the chart


plt.figure(figsize=(12, 8))
plt.barh(categories, values, color='skyblue')
plt.xlabel('Amount (in thousands)')
plt.title('Profit and Loss Statement for 2024')
plt.grid(axis='x')

# Annotate the values on the bars


for index, value in enumerate(values):
plt.text(value, index, f'{value:,}', va='center')

plt.tight_layout()
plt.show()

https://colab.research.google.com/drive/1XzsJ1TaZH5lrrU6ozC1KQrc26R2Mo4jg#scrollTo=OkoA9MYgHXK8&printMode=true 1/2

You might also like