/ Python And R Data science skills: 18 DS Python financial statement analysis Small task Program Telugu

Sunday 4 February 2018

18 DS Python financial statement analysis Small task Program Telugu

18

FINANCIAL STATEMENT ANALYSIS

Scenario: You are a Data Scientist working for a consulting firm. One of your colleagues from the Auditing department has asked you to help them assess the financial statement of organisation X. You have been supplied with two vectors of data: monthly revenue and monthly expenses for the financial year in question. Your task is to calculate the following financial metrics

profit for each month

  • profit after tax for each month (the tax rate is 30%)
  • profit margin for each month - equals to profit after tax divided by revenue
  • good months - where the profit after tax was greater than the mean for the year
  • bad months - where the profit after tax was less than the mean for the year
  • the best month - where the profit after tax was max for the year
  • the worst month - where the profit after tax was min for the year
  • All results need to be presented as vectors.
  • Results for dollar values need to be calculated with $0.01 precision

but need to be presented in Units of $1,000 (i.e. 1k) with no decimal points.

Results for the profit margin ratio need to be presented in units of % with no

decimal points.

Note: Your colleague has warned you that it is okay for tax for any given month to be negative (in accounting terms, negative tax translates into a deferred tax asset).

In [2]:
mi
Out[2]:
[14574.49,
 7606.46,
 8611.41,
 9175.41,
 8058.65,
 8105.44,
 11496.28,
 9766.09,
 10305.32,
 14379.96,
 10713.97,
 15433.5]
In [3]:
me
Out[3]:
[12051.82,
 5695.07,
 12319.2,
 12089.72,
 8658.57,
 840.2,
 3285.73,
 5821.12,
 6976.93,
 16618.61,
 10054.37,
 3803.96]
In [7]:
# proft for month in list
mp = list([]) # declarining empty list

for i in range (0, len(mi)):
    mp.append(mi[i] - me[i])
mp
Out[7]:
[2522.67,
 1911.3900000000003,
 -3707.790000000001,
 -2914.3099999999995,
 -599.9200000000001,
 7265.24,
 8210.550000000001,
 3944.9700000000003,
 3328.3899999999994,
 -2238.6500000000015,
 659.5999999999985,
 11629.54]
In [9]:
mpat=list([])
for i in range(0,len(mp)):
    mpat.append(mp[i]-mp[i]*0.3)
mpat
Out[9]:
[1765.8690000000001,
 1337.9730000000004,
 -2595.4530000000004,
 -2040.0169999999998,
 -419.9440000000001,
 5085.668,
 5747.385,
 2761.4790000000003,
 2329.8729999999996,
 -1567.0550000000012,
 461.719999999999,
 8140.678000000001]
In [31]:
# profut margin
mpm=list([])
for i in range(0,len(mpat)):
    mpm.append((mpat[i]/mi[i] ) * 100)

mpm
Out[31]:
[12.11616324138958,
 17.589956431769842,
 -30.139698376920858,
 -22.233524169492153,
 -5.211096151340486,
 62.74388558795081,
 49.9934326582164,
 28.27619856052934,
 22.60844884001661,
 -10.897492065346505,
 4.3095136536689855,
 52.74680403019406]
In [32]:
mpm = [round(i,2) for i in mpm]
mpm
Out[32]:
[12.12,
 17.59,
 -30.14,
 -22.23,
 -5.21,
 62.74,
 49.99,
 28.28,
 22.61,
 -10.9,
 4.31,
 52.75]
In [35]:
mean_mpat=sum(mpat)/len(mpat)
mean_mpat
Out[35]:
1750.6813333333332
In [ ]:
#goodmonts

No comments:

Post a Comment