FINANCE_DATASET
#1
by hollywoodfrancis - opened
- Discounted Cash Flow Template_28503.xlsx +0 -0
- Financial Statements.csv +162 -0
- IC-Basic-Discounted-Cash-Flow-Valuation-10840.xlsx +0 -0
- IC-Discounted-Cash-Flow-10840.xlsx +0 -0
- IC-Discounted-Cash-Flow-Analysis-10840.xlsx +0 -0
- IC-Discounted-Cash-Flow-Model-10840.xlsx +0 -0
- IC-Discounted-Cash-Flow-Valuation-10840.xlsx +0 -0
- IC-Discounted-Cash-Flow-Valuation-Model-10840.xlsx +0 -0
- IC-Real-Estate-Discounted-Cash-Flow-10840.xlsx +0 -0
- IC-Sample-Discounted-Cash-Flow-10840.xlsx +0 -0
- Simple DCF_88046.xlsx +0 -0
- balance-sheet.xlsx +0 -0
- basic-financial-calculations-using-python.ipynb +604 -0
- cash-flow-statement.xlsx +0 -0
- dcf-calculator-with-python.ipynb +948 -0
- financial-statement-analysis-using-python.ipynb +0 -0
- income-statement (1).xlsx +0 -0
- tesla test.xlsx +0 -0
Discounted Cash Flow Template_28503.xlsx
ADDED
|
Binary file (118 kB). View file
|
|
|
Financial Statements.csv
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Year,Company ,Category,Market Cap(in B USD),Revenue,Gross Profit,Net Income,Earning Per Share,EBITDA,Share Holder Equity,Cash Flow from Operating,Cash Flow from Investing,Cash Flow from Financial Activities,Current Ratio,Debt/Equity Ratio,ROE,ROA,ROI,Net Profit Margin,Free Cash Flow per Share,Return on Tangible Equity,Number of Employees,Inflation Rate(in US)
|
| 2 |
+
2022,AAPL,IT,2066.94,394328,170782,99803,6.11,130541,50672,122151,-22354,-110749,0.8794,2.3695,196.9589,28.2924,66.6994,25.3096,1.3146,196.9589,164000,8.0028
|
| 3 |
+
2021,AAPL,IT,2913.28,365817,152836,94680,5.61,120233,63090,104038,-14545,-93353,1.0746,1.9768,150.0713,26.9742,54.9839,25.8818,1.3261,150.0713,154000,4.6979
|
| 4 |
+
2020,AAPL,IT,2255.97,274515,104956,57411,3.28,77344,65339,80674,-4289,-86820,1.3636,1.7208,87.8664,17.7256,35.0054,20.9136,1.0183,87.8664,147000,1.2336
|
| 5 |
+
2019,AAPL,IT,1304.76,260174,98392,55256,2.97,76477,90488,69391,45896,-90976,1.5401,1.194,61.0645,16.323,30.3113,21.2381,-0.0388,61.0645,137000,1.8122
|
| 6 |
+
2018,AAPL,IT,748.54,265595,101839,59531,2.98,81801,107147,77434,16066,-87876,1.1329,1.0685,55.5601,16.2775,29.6348,22.4142,0.7414,55.5601,132000,2.4426
|
| 7 |
+
2017,AAPL,IT,868.87,229234,88186,48351,2.3025,71501,134047,64225,-46446,-17974,1.2761,0.863,36.0702,12.8826,20.9082,21.0924,0.033,36.0702,123000,2.1301
|
| 8 |
+
2016,AAPL,IT,617.59,215639,84263,45687,2.0775,70529,128249,66231,-45977,-20890,1.3527,0.6786,35.6237,14.2024,22.4312,21.1868,-0.5901,38.1906,116000,1.2616
|
| 9 |
+
2015,AAPL,IT,586.86,233715,93626,53394,2.305,82487,119355,81266,-56274,-17716,1.1088,0.539,44.7355,18.3899,30.9201,22.8458,0.9743,48.3878,110000,0.1186
|
| 10 |
+
2014,AAPL,IT,647.36,182795,70537,39510,1.6125,60449,111547,59713,-22579,-37549,1.0801,0.3164,35.4201,17.042,28.1142,21.6144,0.3032,38.438,97000,1.6222
|
| 11 |
+
2013,AAPL,IT,504.79,170910,64304,37037,1.42,55756,123549,53666,-33774,-16379,1.6786,0.1373,29.9776,17.8923,26.3592,21.6705,0.1363,31.4425,84400,1.4648
|
| 12 |
+
2012,AAPL,IT,500.61,156508,68662,41733,1.5775,58518,118210,50856,-48227,-1698,1.4958,0,35.3041,23.7033,35.3041,26.6651,0.3394,36.9806,76100,2.0693
|
| 13 |
+
2011,AAPL,IT,376.4,108249,43818,25922,0.9886,35604,76615,37529,-40419,1444,1.6084,0,33.8341,22.2753,33.8341,23.9466,0.6278,35.9115,63300,3.1568
|
| 14 |
+
2010,AAPL,IT,296.89,65225,25684,14013,0.5411,19412,47791,18595,-13854,1257,2.0113,0,29.3214,18.6385,29.3214,21.4841,0.2857,30.0013,49400,1.64
|
| 15 |
+
2009,AAPL,IT,189.8,42905,17222,8235,0.3243,12474,31640,10159,-17434,663,2.7425,0,26.0272,17.3365,26.0272,19.1936,0.355,26.4052,36800,-0.3555
|
| 16 |
+
2023,MSFT,IT,2451.23,211915,146052,72361,9.68,102384,206223,87582,-22680,-43935,1.7692,0.2291,35.0887,17.5644,29.1528,34.1462,-0.6808,56.1064,221000,3.7
|
| 17 |
+
2022,MSFT,IT,1787.73,198270,135620,72738,9.65,97843,166542,89035,-30311,-58876,1.7846,0.2989,43.6755,19.937,34.0575,36.6863,1.2643,82.9207,221000,8.0028
|
| 18 |
+
2021,MSFT,IT,2525.08,168088,115856,61271,8.05,81602,141988,76740,-27577,-48486,2.08,0.4095,43.1522,18.3568,31.9017,36.4517,1.4887,72.5298,181000,4.6979
|
| 19 |
+
2020,MSFT,IT,1681.61,143015,96937,44281,5.76,65755,118304,60675,-12223,-46031,2.5158,0.5353,37.4298,14.6961,24.8935,30.9625,0.9526,65.2006,163000,1.2336
|
| 20 |
+
2019,MSFT,IT,1203.06,125843,82933,39240,5.06,54641,102330,52185,-15773,-36887,2.5288,0.7053,38.3465,13.6937,23.22,31.1817,0.7968,74.6661,144000,1.8122
|
| 21 |
+
2018,MSFT,IT,779.67,110360,72007,16571,2.13,45319,82718,43884,-6061,-33590,2.9008,0.9217,20.0331,6.4018,10.6937,15.0154,0.1317,42.5094,131000,2.4426
|
| 22 |
+
2017,MSFT,IT,659.91,96571,62310,25489,3.25,37803,87711,39507,-46781,8408,2.9186,0.9827,29.0602,10.1829,15.5626,26.3941,0.8887,59.9981,124000,2.1301
|
| 23 |
+
2016,MSFT,IT,483.16,91154,58374,20539,2.56,33330,71997,33325,-23950,-8393,2.3529,0.7425,28.5276,10.6162,18.2481,22.5322,0.2435,40.7585,114000,1.2616
|
| 24 |
+
2015,MSFT,IT,443.17,93580,60542,12193,1.48,31616,80083,29668,-23001,-9668,2.4734,0.4407,15.2255,6.9885,11.3012,13.0295,-0.3425,20.911,118000,0.1186
|
| 25 |
+
2014,MSFT,IT,382.88,86833,59755,22074,2.63,32971,89784,32502,-18833,-8665,2.504,0.2522,24.5857,12.8051,19.9893,25.4212,0.3152,35.2192,128000,1.6222
|
| 26 |
+
2013,MSFT,IT,312.3,77849,57464,21863,2.58,30519,78944,28833,-23811,-8148,2.7118,0.1976,27.6943,15.3499,23.8822,28.0839,-0.5456,35.7204,118000,1.4648
|
| 27 |
+
2012,MSFT,IT,224.8,73723,56193,16978,2,30923,66363,31626,-24786,-9408,2.6029,0.18,25.5835,14.0001,22.0276,23.0295,0.5798,34.1328,128000,2.0693
|
| 28 |
+
2011,MSFT,IT,218.38,69943,54366,23150,2.69,29927,57083,26994,-14616,-8376,2.6037,0.2088,40.555,21.2964,33.5488,33.0984,0.3921,52.9046,99000,3.1568
|
| 29 |
+
2010,MSFT,IT,238.78,62484,50089,18760,2.1,26771,46175,24073,-11314,-13291,2.1293,0.1286,40.628,21.7853,36.7023,30.0237,0.7057,57.5054,94000,1.64
|
| 30 |
+
2009,MSFT,IT,270.64,58437,46282,14569,1.62,22925,39558,19037,-15770,-7463,1.8229,0.1453,36.8295,18.7051,33.6435,24.9311,1.7695,57.5941,90000,-0.3555
|
| 31 |
+
2022,GOOG,IT,1144.35,282836,156633,59972,4.56,90770,256144,91495,-20298,-69757,2.378,0.0574,23.4134,16.4188,22.1426,21.2038,-0.3613,26.6424,190234,8.0028
|
| 32 |
+
2021,GOOG,IT,1910.26,257637,146698,76033,5.61,91155,251635,91652,-35523,-61362,2.9281,0.0589,30.2156,21.1633,28.5354,29.5117,1.7123,33.4561,156500,4.6979
|
| 33 |
+
2020,GOOG,IT,1179.4,182527,97795,40269,2.93,54921,222544,65124,-32773,-24408,3.0668,0.0626,18.0949,12.5992,17.0288,22.0619,0.843,20.1422,135301,1.2336
|
| 34 |
+
2019,GOOG,IT,917.82,161857,89961,34343,2.458,46012,201442,54520,-29491,-23209,3.3741,0.0226,17.0486,12.4472,16.6717,21.2181,0.5566,19.2033,118899,1.8122
|
| 35 |
+
2018,GOOG,IT,719.63,136819,77270,30736,2.185,36559,177628,47971,-28504,-13179,3.919,0.0226,17.3036,13.2032,16.9214,22.4647,-0.0705,19.5124,98771,2.4426
|
| 36 |
+
2017,GOOG,IT,726.47,110855,65272,12662,0.9,33093,152502,37091,-31401,-8298,5.1403,0.026,8.3028,6.4178,8.0922,11.4221,-0.151,9.5158,80110,2.1301
|
| 37 |
+
2016,GOOG,IT,530.84,90272,55134,19478,1.3925,29860,139036,36036,-31165,-8332,6.2908,0.0283,14.0093,11.6289,13.6237,21.577,0.6249,16.3323,72053,1.2616
|
| 38 |
+
2015,GOOG,IT,521.67,74989,46825,15826,1.142,24423,120331,26572,-23711,-4225,4.6667,0.0434,13.5859,11.0863,13.3643,21.1044,0.3054,16.2481,61814,0.1186
|
| 39 |
+
2014,GOOG,IT,354.75,66001,40310,14136,1.0285,21475,103860,23024,-21055,-2087,4.6878,0.0504,13.1138,10.5429,12.7185,21.4179,0.0463,16.2814,53600,1.6222
|
| 40 |
+
2013,GOOG,IT,371.53,55519,33526,12733,0.9395,19342,87309,18659,-13679,-857,4.5817,0.0601,15.0729,11.8644,14.6965,22.9345,-0.2373,18.8671,47756,1.4648
|
| 41 |
+
2012,GOOG,IT,230.54,46039,28863,10737,0.808,16796,71715,16619,-13056,1229,4.2166,0.0772,16.1096,12.3169,15.4652,23.3215,0.1539,21.512,53861,2.0693
|
| 42 |
+
2011,GOOG,IT,207.65,37905,24717,9737,0.744,13593,58145,14565,-19041,807,5.9192,0.0723,16.7461,13.4167,15.9281,25.6879,0.3039,19.7822,32467,3.1568
|
| 43 |
+
2010,GOOG,IT,188.54,29321,18904,8505,0.6578,11777,46241,11081,-10680,3050,4.1579,0.0749,18.3928,14.7016,18.3928,29.0065,-0.1195,21.8407,24400,1.64
|
| 44 |
+
2009,GOOG,IT,195.27,23651,14807,6520,0.5103,9836,36004,9316,-8019,233,10.6178,0,18.1091,16.1,18.1091,27.5675,0.6657,21.4997,19835,-0.3555
|
| 45 |
+
2022,PYPL,FinTech,81.19,27518,11653,2419,2.09,5154,20274,5813,-3421,-1110,1.2753,0.5138,11.9315,3.073,7.8818,8.7906,0.288,29.2256,29900,8.0028
|
| 46 |
+
2021,PYPL,FinTech,221.57,25371,11921,4169,3.52,5527,21727,5797,-5149,-557,1.2218,0.3705,19.1881,5.4998,14.0012,16.4322,-0.4843,46.6279,30900,4.6979
|
| 47 |
+
2020,PYPL,FinTech,274.41,21454,10001,4202,3.54,4478,20063,6219,-16545,12454,1.3264,0.4455,20.944,5.9705,14.4887,19.5861,1.7623,42.5304,26500,1.2336
|
| 48 |
+
2019,PYPL,FinTech,127.01,17772,7987,2459,2.07,3631,16929,4071,-5742,4187,1.43,0.2933,14.5254,4.7903,11.2314,13.8364,-1.0251,24.7409,23200,1.8122
|
| 49 |
+
2018,PYPL,FinTech,99.09,15451,7189,2057,1.71,2970,15386,5480,821,-1240,1.2725,0.1299,13.3693,4.7471,13.3693,13.3131,2.347,24.852,21800,2.4426
|
| 50 |
+
2017,PYPL,FinTech,88.48,13094,6399,1795,1.47,2932,15994,2531,-4485,4084,1.4279,0.0625,11.223,4.4023,11.223,13.7086,-0.5169,15.6264,18700,2.1301
|
| 51 |
+
2016,PYPL,FinTech,47.63,10842,5141,1401,1.15,2310,14712,3158,-5904,2038,1.5246,0,9.5228,4.2322,9.5228,12.922,0.5382,13.417,18100,1.2616
|
| 52 |
+
2015,PYPL,FinTech,44.23,9248,4719,1228,1,2069,13759,2546,-8038,4728,1.5163,0,8.9251,4.2519,8.9251,13.2786,0.0935,13.159,16800,0.1186
|
| 53 |
+
2014,PYPL,FinTech,,8025,4218,419,0.34,1784,8248,2220,-2881,1284,1.3224,0.1325,5.08,1.9118,5.08,5.2212,0.103,8.5458,15800,1.6222
|
| 54 |
+
2022,AIG,Bank,46.99,56437,20762,10247,13.01,20640,42235,4207,-3626,-676,1,0.6435,27.0084,2.1411,16.2446,18.1565,-1.9207,26.6982,26200,8.0028
|
| 55 |
+
2021,AIG,Bank,47.21,52057,15322,9359,10.82,15382,68912,6279,-3280,-3735,1,0.4377,14.5016,1.6646,10.0157,17.9784,6.0658,14.3995,36600,4.6979
|
| 56 |
+
2020,AIG,Bank,32.62,43736,6912,-5973,-6.88,6821,67199,1038,-6202,5058,1,0.5586,-8.7433,-0.9946,-5.5694,-13.6569,3.2256,-8.6802,45000,1.2336
|
| 57 |
+
2019,AIG,Bank,44.65,49746,11975,3326,3.74,11817,67427,-1807,-5475,7258,1,0.5243,6.1561,0.7849,4.0097,6.686,-1.5986,6.1118,46000,1.8122
|
| 58 |
+
2018,AIG,Bank,34.86,47389,6921,-6,-0.01,6897,57309,-394,-223,1249,1,0.6027,0.1797,0.0209,0.1121,-0.0127,7.9685,0.1797,49600,2.4426
|
| 59 |
+
2017,AIG,Bank,53.56,49520,6849,-6084,-6.54,6435,65708,-7818,14041,-5697,1,0.4815,-9.2226,-1.2161,-6.2251,-12.2859,-11.611,-9.2226,49800,2.1301
|
| 60 |
+
2016,AIG,Bank,67.08,52367,5236,-849,-0.78,4805,76858,3502,3252,-6833,1,0.4022,-0.337,-0.052,-0.2403,-1.6213,1.0537,-0.337,56400,1.2616
|
| 61 |
+
2015,AIG,Bank,76.66,58327,10565,2196,1.65,9958,90210,2877,8462,-11429,1,0.3242,2.4631,0.4472,1.8601,3.765,-1.303,2.4631,66400,0.1186
|
| 62 |
+
2014,AIG,Bank,78.41,64406,19219,7529,5.2,16752,107272,5007,14284,-19788,1,0.291,7.0606,1.469,5.469,11.6899,-0.5007,7.0606,65000,1.6222
|
| 63 |
+
2013,AIG,Bank,75.16,68874,21915,9085,6.13,16922,101081,5865,7099,-11758,1,0.4125,8.9117,1.6641,6.3093,13.1908,1.7809,8.9117,64000,1.4648
|
| 64 |
+
2012,AIG,Bank,52.11,71214,21825,3438,2.04,19327,98669,3676,16612,-20564,1,0.4915,3.7489,0.6742,2.5134,4.8277,2.2237,3.7489,63000,2.0693
|
| 65 |
+
2011,AIG,Bank,44.06,65105,18692,19810,11.01,15225,102393,-81,36448,-36926,1,0.7349,18.4222,3.4107,10.6183,30.4278,-121.5022,18.4222,57000,3.1568
|
| 66 |
+
2010,AIG,Bank,7.79,72829,16787,2046,14.98,21166,113239,16597,-9912,-9261,1,0.7548,32.1262,1.9393,6.6699,2.8093,-15.8715,11.7045,63000,1.64
|
| 67 |
+
2009,AIG,Bank,4.04,75447,18614,-12244,-90.48,27765,98076,18584,5778,-28997,1,1.1552,-45.3061,-1.5123,-6.0641,-16.2286,137.3287,-13.9507,96000,-0.3555
|
| 68 |
+
2022,PCG,Manufacturing,41.28,21680,16824,1800,0.84,5693,23075,3721,-10214,7133,0.8117,2.2563,7.8613,1.5289,2.5615,8.3026,-0.016,7.8613,26010,8.0028
|
| 69 |
+
2021,PCG,Manufacturing,32.2,20642,16261,-102,-0.05,5286,21223,2262,-6905,4323,0.6356,2.1152,-0.4146,-0.0852,-0.148,-0.4941,18.6025,-0.4146,26000,4.6979
|
| 70 |
+
2020,PCG,Manufacturing,24.1,18469,14571,-1318,-1.05,5223,21253,-19130,-7748,25928,0.707,1.9227,-6.1356,-1.3326,-2.2275,-7.1363,-18.5013,-6.1356,24000,1.2336
|
| 71 |
+
2019,PCG,Manufacturing,24.73,17129,13300,-7656,-14.5,-6860,5388,4816,-6378,1464,1.3321,0,-141.8337,-8.9699,-141.8337,-44.6961,0.5729,-141.8337,23000,1.8122
|
| 72 |
+
2018,PCG,Manufacturing,5.75,16759,12260,-6851,-13.25,-6664,12903,4752,-6564,3031,0.2205,1.7046,-52.9877,-8.8798,-52.9877,-40.8795,-4.0631,-52.9877,24000,2.4426
|
| 73 |
+
2017,PCG,Manufacturing,12.32,17135,12080,1646,3.21,5759,19472,5977,-5650,-55,0.881,0.9824,8.5251,2.4407,4.4594,9.6061,3.2498,8.5251,23000,2.1301
|
| 74 |
+
2016,PCG,Manufacturing,23.06,17666,12286,1393,2.78,4835,18192,4409,-5753,1171,0.8149,1.0134,7.7342,2.0511,4.0887,7.8852,0.2656,7.7342,24000,1.2616
|
| 75 |
+
2015,PCG,Manufacturing,30.73,16833,11071,874,1.79,4120,16828,3780,-5211,1403,0.9136,1.0164,5.2769,1.4043,2.7112,5.1922,-0.4285,5.2769,23000,0.1186
|
| 76 |
+
2014,PCG,Manufacturing,26.09,17090,10521,1436,3.06,4883,16000,3690,-4714,879,1.0792,0.9802,9.0625,2.4116,4.6699,8.4026,1.5681,9.0625,22581,1.6222
|
| 77 |
+
2013,PCG,Manufacturing,25.29,15598,9614,814,1.83,3839,14594,3427,-5107,1575,0.7977,1.0127,5.6736,1.4891,3.0317,5.2186,-4.6071,5.6736,21166,1.4648
|
| 78 |
+
2012,PCG,Manufacturing,18.1,15040,10017,816,1.92,3965,13326,4882,-4526,-468,0.8186,1.0062,6.2284,1.5825,3.2117,5.4255,1.3509,6.2284,20593,2.0693
|
| 79 |
+
2011,PCG,Manufacturing,17.14,14956,9623,844,2.1,4157,12353,3739,-3986,469,0.8362,1.1241,6.9457,1.7246,3.5574,5.6432,0.7766,6.9457,19274,3.1568
|
| 80 |
+
2010,PCG,Manufacturing,16.73,13841,8652,1099,2.82,4213,11534,3206,-3857,415,0.7713,1.1613,9.6497,2.4183,4.8681,7.9402,0.8604,9.6497,19424,1.64
|
| 81 |
+
2009,PCG,Manufacturing,18.76,13399,8397,1220,3.2,4051,10585,3039,-3336,605,0.8303,1.2063,11.658,2.8734,5.6624,9.1052,-2.3808,11.658,19425,-0.3555
|
| 82 |
+
2018,SHLDQ,Finance,0.04,16702,3527,-383,-3.57,-52,-3723,-1842,1894,-2,0.7756,-1.1099,10.2874,-5.274,25.9837,-2.2931,3.0663,7.4225,89900,2.4426
|
| 83 |
+
2017,SHLDQ,Finance,0.37,22138,4686,-2221,-20.78,-1610,-3824,-1381,244,1185,1.0673,-1.0887,58.0805,-23.7236,884.8605,-10.0325,-13.9382,39.5618,140000,2.1301
|
| 84 |
+
2016,SHLDQ,Finance,1.11,25146,5810,-1129,-10.59,-570,-1956,-2167,2519,-364,1.1116,-1.5215,57.6687,-9.9497,-742.1052,-4.4898,14.9014,27.2859,178000,1.2616
|
| 85 |
+
2015,SHLDQ,Finance,2.19,31198,7149,-1682,-15.82,-889,-945,-1387,327,285,1.0479,-3.9958,191.5344,-13.7277,-84.5005,-5.3914,-7.424,54.6663,196000,0.1186
|
| 86 |
+
2014,SHLDQ,Finance,3.51,36188,8755,-1365,-12.87,-195,2183,-1109,664,902,1.0946,1.9464,-51.1223,-6.1114,-22.2444,-3.772,-2.7683,106.6922,226000,1.6222
|
| 87 |
+
2013,SHLDQ,Finance,4.9,39854,10514,-930,-8.78,-8,3172,-303,191,-27,1.1011,0.9836,-33.2283,-5.4498,-20.6061,-2.3335,4.5387,1197.727,246000,1.4648
|
| 88 |
+
2012,SHLDQ,Finance,4.47,41567,10601,-3140,-29.4,-648,4341,-275,-309,-28,1.112,0.8047,-71.8728,-14.5924,-48.5301,-7.5541,-3.5464,-554.1741,264000,2.0693
|
| 89 |
+
2011,SHLDQ,Finance,3.39,42664,11664,133,1.19,1306,8614,123,-406,-95,1.3375,0.3707,1.6137,0.5706,1.2685,0.3117,-12.4078,3.2868,280000,3.1568
|
| 90 |
+
2010,SHLDQ,Finance,8.22,43360,11986,235,1.99,1561,9435,1507,-172,-951,1.3018,0.2655,2.9677,1.1287,2.515,0.542,5.4337,5.7911,290000,1.64
|
| 91 |
+
2009,SHLDQ,Finance,8.98,46770,12652,53,0.42,1283,9699,992,-637,-643,1.3412,0.301,1.0207,0.3907,0.8368,0.1133,4.5748,1.9705,291000,-0.3555
|
| 92 |
+
2022,MCD,FOOD,186.39,23182.6,13207.2,6177.4,8.33,11241.6,-6003.4,7386.7,-2678.1,-6580.2,1.4266,-5.9805,-102.8983,12.2481,20.6601,26.6467,-2.1323,-69.3794,150000,8.0028
|
| 93 |
+
2021,MCD,FOOD,193.02,23222.9,12580.2,7545.2,10.04,12224.1,-4601,9141.5,-2165.7,-5595.6,1.7782,-7.7424,-163.9903,14.0104,24.3223,32.4903,3.3857,-102.19,200000,4.6979
|
| 94 |
+
2020,MCD,FOOD,200.31,19207.8,9752.101,4730.5,6.31,9075.4,-7824.9,6265.2,-1545.8,-2249,1.01,-4.7848,-60.4545,8.9888,17.2823,24.628,-1.4852,-44.6358,200000,1.2336
|
| 95 |
+
2019,MCD,FOOD,159.89,21364.4,11179.4,6025.4,7.88,10687.7,-8210.3,8122.1,-3071.1,-4994.8,0.9826,-4.1627,-73.3883,12.6822,23.2571,28.203,2.1046,-55.3414,205000,1.8122
|
| 96 |
+
2018,MCD,FOOD,148.82,21257.9,10832.6,5924.3,7.54,10304.6,-6258.4,6966.7,-2455.1,-5949.6,1.3631,-4.9654,-94.6616,18.0557,23.872,27.8687,0.8436,-68.9682,210000,2.4426
|
| 97 |
+
2017,MCD,FOOD,136.89,22820.4,10620.8,5192.3,6.37,10916.1,-3268,5551.2,562,-5310.8,1.8429,-9.0381,-158.8832,15.3602,19.7663,22.7529,-0.2793,-91.9365,235000,2.1301
|
| 98 |
+
2016,MCD,FOOD,137.21,24621.9,10204.7,4686.5,5.44,9261.002,-2204.3,6059.6,-981.6,-11262.4,1.398,-11.775,-212.6069,15.1061,19.7958,19.0339,-0.21,-103.2087,375000,1.2616
|
| 99 |
+
2015,MCD,FOOD,101.08,25413,9789.2,4529.3,4.8,8701.2,7087.9,6539.1,-1420,735.3,3.2684,3.4033,63.9019,11.9385,14.5123,17.8228,0.9354,99.0748,420000,0.1186
|
| 100 |
+
2014,MCD,FOOD,108.48,27441.3,10455.7,4757.8,4.82,9593.701,12853.4,6730.3,-2304.9,-4618.3,1.5232,1.162,37.0159,13.9006,17.1211,17.3381,0.0221,47.0227,420000,1.6222
|
| 101 |
+
2013,MCD,FOOD,91.19,28105.7,10902.7,5585.9,5.55,10349.4,16009.7,7120.7,-2673.8,-4043,1.5931,0.8826,34.8907,15.2511,18.5335,19.8746,0.4311,42.5204,440000,1.4648
|
| 102 |
+
2012,MCD,FOOD,96.55,27567,10816.3,5464.8,5.36,10093.1,15293.6,6966.1,-3167.3,-3849.8,1.4464,0.8914,35.7326,15.4432,18.8923,19.8237,-0.3911,43.7548,440000,2.0693
|
| 103 |
+
2011,MCD,FOOD,88.56,27006,10686.6,5503.1,5.27,9944.701,14390.2,7150.1,-2570.9,-4533,1.2547,0.8687,38.242,16.6812,20.7476,20.3773,0.3369,46.8868,420000,3.1568
|
| 104 |
+
2010,MCD,FOOD,102.66,24074.6,9637.3,4946.3,4.58,8749.3,14634.2,6341.6,-2056,-3728.7,1.4937,0.7862,33.7996,15.4692,18.9287,20.5457,0.463,41.0546,400000,1.64
|
| 105 |
+
2009,MCD,FOOD,81.1,22744.7,8791.8,4551,4.11,8057.2,14033.9,5751,-1655.3,-4421,1.1431,0.7538,32.4286,15.0571,18.5044,20.0091,3.4305,39.2034,385000,-0.3555
|
| 106 |
+
2022,BCS,BANK,32.53,30868.08,30868.08,6212.949,1.4744,1,85667.7,37392.72,-26807.33,860.8824,1,7.1602,8.624,0.3946,1.284,21.162,-6.5477,9.7884,87400,8.0028
|
| 107 |
+
2021,BCS,BANK,43.6,30169.69,30169.69,8766.263,2.0131,1,96547.15,67268.52,5871.677,147.1357,1,6.3396,10.2918,0.522,1.6696,28.2167,-1.4283,11.6267,81600,4.6979
|
| 108 |
+
2020,BCS,BANK,34.66,27947.54,27947.54,1959.384,0.4416,1,85876.48,73836.42,-23594.78,3507.888,1,6.0327,3.6796,0.1824,0.602,9.0147,20.4341,4.1759,83000,1.2336
|
| 109 |
+
2019,BCS,BANK,40.78,27621.9,27621.9,4180.571,0.72,1,83841.26,-15699.49,-16377.52,881.061,1,5.3348,5.1081,0.2942,0.9201,16.6024,-6.2895,5.8289,80800,1.8122
|
| 110 |
+
2018,BCS,BANK,31.68,28212.33,28212.33,1860.711,0.4912,1,85132.21,11351.14,903.6596,-9059.288,1,5.8975,3.7191,0.2093,0.6186,7.0877,-15.5712,4.2504,83500,2.4426
|
| 111 |
+
2017,BCS,BANK,45.79,27162.75,27162.75,-2477.073,-0.573,1,85081.42,78244.34,4513.377,1238.537,1,5.2797,1.9707,0.1148,0.3862,-10.2561,14.5974,2.2367,79900,2.1301
|
| 112 |
+
2016,BCS,BANK,46.21,29072.54,29072.54,2373.13,0.5584,1,96720.98,15295.92,49749,-1784.93,1,3.5002,3.1346,0.1844,0.8387,9.1781,-2.4382,3.5151,119300,1.2616
|
| 113 |
+
2015,BCS,BANK,53.45,38919.16,38919.16,-495.396,-0.1162,1,100706.1,24659.71,-12895.59,-674.289,1,3.6646,0.9459,0.0556,0.251,-1.3882,9.9996,1.0808,129400,0.1186
|
| 114 |
+
2014,BCS,BANK,60.47,41677.15,41677.15,-197.7716,-0.046,1,108705.4,-17207.81,17560.51,-5039.89,1,5.0612,1.2811,0.0622,0.3671,-0.519,6.6557,1.4625,132300,1.6222
|
| 115 |
+
2013,BCS,BANK,55.49,43712.69,43712.69,846.5568,0.232,1,100067.4,-39392.27,-35434.89,9247.968,1,6.6208,2.0282,0.0988,0.547,2.1758,-3.8585,2.3052,139600,1.4648
|
| 116 |
+
2012,BCS,BANK,52.82,46036.06,46036.06,-1650.089,-0.539,1,99793.14,-21741.23,-11252.63,-4504.854,1,7.688,-0.3749,-0.0158,-0.0829,-4.0909,-21.998,-0.4288,139200,2.0693
|
| 117 |
+
2011,BCS,BANK,33.47,48866.82,48866.82,6338.98,1.54,1,104600.5,46654.34,-3067.61,-9563.82,1,7.6045,4.6122,0.1923,1.368,12.2352,6.1199,5.2432,141100,3.1568
|
| 118 |
+
2010,BCS,BANK,47.13,49030.07,49030.07,7034.11,1.84,1,96275.73,28894.16,-8701.03,245.86,1,9.3328,6.0555,0.2531,1.5241,14.4688,-12.8733,7.0387,147500,1.64
|
| 119 |
+
2009,BCS,BANK,36.84,45992.04,45992.04,5497.87,5.12,1,91570.7,65523.51,18026.64,-1035.05,1,8.5152,19.5283,0.8282,5.1862,12.0558,21.5535,22.9851,144200,-0.3555
|
| 120 |
+
2023,NVDA,ELEC,1000.35,26974,15356,4368,1.74,5768,22101,5641,7375,-11617,3.5156,0.4956,19.7638,10.6066,13.7341,16.1934,-1.689,27.2099,26196,3.7
|
| 121 |
+
2022,NVDA,ELEC,359.5,26914,17475,9752,3.85,11215,26612,9108,-9830,1865,6.6503,0.4113,36.6451,22.0698,25.9652,36.2339,1.3378,48.946,22473,8.0028
|
| 122 |
+
2021,NVDA,ELEC,735.86,16675,10396,4332,1.73,5630,16893,5822,-19675,3804,4.0904,0.4122,25.6438,15.0464,18.9526,25.979,0.1419,43.4809,18975,4.6979
|
| 123 |
+
2020,NVDA,ELEC,323.24,10918,6768,2796,1.13,3227,12204,4761,6145,-792,7.6738,0.1631,22.9105,16.1479,19.6971,25.6091,0.471,24.2351,13775,1.2336
|
| 124 |
+
2019,NVDA,ELEC,144,11716,7171,4141,1.6575,4066,9342,3743,-4097,-2866,7.9436,0.2128,44.3267,31.1541,36.549,35.3448,0.1057,47.7129,13277,1.8122
|
| 125 |
+
2018,NVDA,ELEC,81.44,9714,5822,3047,1.205,3409,7471,3502,1278,-2544,8.0269,0.2677,40.7844,27.1061,32.2229,31.3671,0.5725,44.8022,11528,2.4426
|
| 126 |
+
2017,NVDA,ELEC,117.26,6910,4063,1666,0.6425,2121,5762,1672,-793,291,4.774,0.4877,28.9136,16.9292,21.4249,24.11,0.0975,33.0556,10299,2.1301
|
| 127 |
+
2016,NVDA,ELEC,57.53,5010,2811,614,0.27,973,4469,1175,-400,-676,2.5746,0.3379,13.7391,8.3311,13.4472,12.2555,0.124,16.6621,9227,1.2616
|
| 128 |
+
2015,NVDA,ELEC,17.73,4682,2599,631,0.28,1007,4418,906,-727,-834,6.3761,0.3164,14.2825,8.7627,10.8494,13.4772,0.1033,17.6356,9228,0.1186
|
| 129 |
+
2014,NVDA,ELEC,10.9,4130,2268,440,0.185,740,4456.398,835,-806,390,5.949,0.3083,9.8734,6.0682,7.5468,10.6538,-0.0022,12.5099,8808,1.6222
|
| 130 |
+
2013,NVDA,ELEC,9.11,4280.159,2226.343,562.536,0.225,874.4742,4827.703,824.172,-743.992,-15.27,4.8916,0.0039,11.6523,8.7728,11.6066,13.1429,-0.0561,14.5195,7974,1.4648
|
| 131 |
+
2012,NVDA,ELEC,7.66,3997.93,2056.517,581.09,0.235,852.5038,4145.724,909.156,-1143.364,236.723,4.1995,0.0052,14.0166,10.4646,13.9445,14.5348,0.0671,18.2816,7133,2.0693
|
| 132 |
+
2011,NVDA,ELEC,8.46,3543.309,1409.09,253.146,0.1075,442.7361,3181.462,675.797,-649.678,192.021,3.4232,0.0074,7.9569,5.6314,7.8988,7.1443,0.0588,10.034,6029,3.1568
|
| 133 |
+
2010,NVDA,ELEC,8.95,3326.445,1176.923,-67.987,-0.03,97.7189,2665.14,487.807,-519.333,61.059,3.1628,0.0092,-2.551,-1.8959,-2.5278,-2.0438,0.2588,-3.1261,5706,1.64
|
| 134 |
+
2009,NVDA,ELEC,10.37,3424.859,1174.269,-30.041,-0.0125,114.3228,2394.652,249.36,-209.367,-349.274,2.7845,0.0107,-1.2545,-0.8966,-1.2412,-0.8771,-0.0722,-1.5999,5420,-0.3555
|
| 135 |
+
2022,INTC,ELEC,109.08,63054,26866,8014,1.94,15369,103286,15433,-10477,1361,1.5676,0.4071,7.7619,4.4025,5.687,12.7097,-4.564,11.506,131900,8.0028
|
| 136 |
+
2021,INTC,ELEC,209.45,79024,43815,19868,4.86,31248,95391,29456,-24449,-6045,2.1323,0.3994,20.828,11.7977,15.4134,25.1417,-2.8278,32.4864,121100,4.6979
|
| 137 |
+
2020,INTC,ELEC,104.16,77867,43612,20899,4.94,35917,81038,35864,-21524,-12669,1.9087,0.4492,25.7891,13.6514,18.1833,26.8394,1.2739,46.4,110600,1.2336
|
| 138 |
+
2019,INTC,ELEC,260.35,71965,42140,21048,4.71,32861,77504,33145,-14405,-17565,1.4002,0.3742,27.1573,15.4171,20.4723,29.2476,0.7539,52.0977,110800,1.8122
|
| 139 |
+
2018,INTC,ELEC,214.19,70848,43737,21053,4.48,32401,74563,29432,-11239,-18607,1.7314,0.3535,28.2352,16.4524,21.1246,29.7157,0.8946,55.0924,107400,2.4426
|
| 140 |
+
2017,INTC,ELEC,216.03,62761,39098,9601,1.99,26179,69019,22110,-15762,-8475,1.6934,0.3885,13.9107,7.7899,10.2078,15.2977,-0.3622,30.1113,102700,2.1301
|
| 141 |
+
2016,INTC,ELEC,171.88,59387,36233,10316,2.12,20923,66226,21808,-25817,-5739,1.749,0.3818,15.577,9.1029,11.8745,17.3708,0.1101,24.1972,106000,1.2616
|
| 142 |
+
2015,INTC,ELEC,162.57,55355,34679,11420,2.33,22713,61085,19018,-8183,1912,2.4492,0.3711,18.6953,11.2558,14.0777,20.6305,0.3492,24.9236,107300,0.1186
|
| 143 |
+
2014,INTC,ELEC,175.46,55870,35609,11704,2.31,23896,55865,20418,-9905,-13611,1.7319,0.2444,20.9505,12.7356,17.231,20.9486,0.0651,28.8574,106700,1.6222
|
| 144 |
+
2013,INTC,ELEC,129.02,52708,31521,9620,1.89,20323,58256,20776,-18073,-5498,2.3647,0.2308,16.5133,10.416,13.4694,18.2515,0.452,22.5859,107600,1.4648
|
| 145 |
+
2012,INTC,ELEC,102.61,53341,33151,11005,2.13,22160,51203,18884,-14060,-1408,2.4312,0.2626,21.4929,13.0467,17.1047,20.6314,-0.3622,31.2128,105000,2.0693
|
| 146 |
+
2011,INTC,ELEC,123.48,53999,33757,12942,2.39,23541,45911,20963,-10301,-11100,2.151,0.1597,28.1893,18.1977,24.4212,23.9671,-0.1314,42.5864,100100,3.1568
|
| 147 |
+
2010,INTC,ELEC,117.31,43623,28491,11464,2.01,20226,49430,16692,-10539,-4642,3.3892,0.0428,23.1924,18.1433,22.2572,26.2797,0.8374,26.0315,82500,1.64
|
| 148 |
+
2009,INTC,ELEC,112.65,35127,19561,4369,0.77,10763,41704,11170,-7965,-2568,2.7871,0.0533,10.4762,8.2286,9.9856,12.4377,1.1789,11.7185,79800,-0.3555
|
| 149 |
+
2022,AMZN,LOGI,856.94,513983,225152,-2722,-0.27,54169,146043,46752,-37601,9718,0.9446,0.4598,-1.8638,-0.5883,-1.2768,-0.5296,-0.2546,-2.1645,1541000,8.0028
|
| 150 |
+
2021,AMZN,LOGI,1691,469822,197478,33364,3.24,59312,138245,46327,-58154,6291,1.1358,0.3526,24.134,7.9334,17.8428,7.1014,-3.9226,27.153,1608000,4.6979
|
| 151 |
+
2020,AMZN,LOGI,1634.16,386064,152757,21331,2.09,48079,93404,66064,-59611,-1104,1.0502,0.3406,22.8374,6.6411,17.0348,5.5252,0.4798,27.2124,1298000,1.2336
|
| 152 |
+
2019,AMZN,LOGI,916.15,280522,114986,11588,1.1505,36330,62060,38514,-24281,-10066,1.097,0.3773,18.6723,5.1446,13.5573,4.1309,0.622,24.4958,798000,1.8122
|
| 153 |
+
2018,AMZN,LOGI,734.42,232887,93731,10073,1.007,27762,43549,30723,-12369,-7686,1.0981,0.5395,23.1303,6.1931,15.0245,4.3253,1.0975,34.7333,647500,2.4426
|
| 154 |
+
2017,AMZN,LOGI,563.54,177866,65932,3033,0.3075,15584,27709,18365,-27084,9928,1.04,0.893,10.9459,2.3098,5.7824,1.7052,-0.2387,21.1226,566000,2.1301
|
| 155 |
+
2016,AMZN,LOGI,356.31,135987,47722,2371,0.245,12302,19285,17203,-9516,-3716,1.0448,0.399,12.2945,2.8429,8.7883,1.7435,0.3003,15.2958,341400,1.2616
|
| 156 |
+
2015,AMZN,LOGI,316.83,107006,35355,596,0.0625,8514,13384,12039,-6450,-3882,1.0536,0.6147,4.4531,0.9205,2.7579,0.557,0.57,6.1922,230800,0.1186
|
| 157 |
+
2014,AMZN,LOGI,143.7,88988,26236,-241,-0.026,4924,10741,6842,-5065,4432,1.1153,0.7695,-2.2437,-0.4422,-1.268,-0.2708,-0.0075,-3.2471,154100,1.6222
|
| 158 |
+
2013,AMZN,LOGI,182.54,74452,20271,274,0.0295,3998,9746,5475,-4276,-539,1.0716,0.3274,2.8114,0.6823,2.118,0.368,0.1748,3.8641,117300,1.4648
|
| 159 |
+
2012,AMZN,LOGI,113.63,61093,15122,-39,-0.0045,2835,8192,4180,-3595,2259,1.1207,0.3765,-0.4761,-0.1198,-0.3459,-0.0638,-0.1833,-0.6915,88400,2.0693
|
| 160 |
+
2011,AMZN,LOGI,78.72,48077,10789,631,0.0685,1945,7757,3903,-1930,-482,1.1741,0.0329,8.1346,2.4962,7.8757,1.3125,-0.049,10.8756,56200,3.1568
|
| 161 |
+
2010,AMZN,LOGI,80.79,34204,7643,1152,0.1265,1974,6864,3495,-3360,181,1.3254,0.2274,16.7832,6.1286,13.6736,3.368,-0.0544,20.8885,33700,1.64
|
| 162 |
+
2009,AMZN,LOGI,58.24,24509,5531,902,0.102,1507,5257,3293,-2337,-280,1.3304,0.2007,17.1581,6.5301,17.1581,3.6803,0.3303,22.4211,24300,-0.3555
|
IC-Basic-Discounted-Cash-Flow-Valuation-10840.xlsx
ADDED
|
Binary file (306 kB). View file
|
|
|
IC-Discounted-Cash-Flow-10840.xlsx
ADDED
|
Binary file (370 kB). View file
|
|
|
IC-Discounted-Cash-Flow-Analysis-10840.xlsx
ADDED
|
Binary file (315 kB). View file
|
|
|
IC-Discounted-Cash-Flow-Model-10840.xlsx
ADDED
|
Binary file (331 kB). View file
|
|
|
IC-Discounted-Cash-Flow-Valuation-10840.xlsx
ADDED
|
Binary file (317 kB). View file
|
|
|
IC-Discounted-Cash-Flow-Valuation-Model-10840.xlsx
ADDED
|
Binary file (347 kB). View file
|
|
|
IC-Real-Estate-Discounted-Cash-Flow-10840.xlsx
ADDED
|
Binary file (308 kB). View file
|
|
|
IC-Sample-Discounted-Cash-Flow-10840.xlsx
ADDED
|
Binary file (312 kB). View file
|
|
|
Simple DCF_88046.xlsx
ADDED
|
Binary file (50.1 kB). View file
|
|
|
balance-sheet.xlsx
ADDED
|
Binary file (35.2 kB). View file
|
|
|
basic-financial-calculations-using-python.ipynb
ADDED
|
@@ -0,0 +1,604 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "code",
|
| 5 |
+
"execution_count": 1,
|
| 6 |
+
"id": "f40d6afc",
|
| 7 |
+
"metadata": {
|
| 8 |
+
"_cell_guid": "b1076dfc-b9ad-4769-8c92-a6c4dae69d19",
|
| 9 |
+
"_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e0e5",
|
| 10 |
+
"execution": {
|
| 11 |
+
"iopub.execute_input": "2021-08-04T16:56:03.260456Z",
|
| 12 |
+
"iopub.status.busy": "2021-08-04T16:56:03.259672Z",
|
| 13 |
+
"iopub.status.idle": "2021-08-04T16:56:03.262950Z",
|
| 14 |
+
"shell.execute_reply": "2021-08-04T16:56:03.262329Z",
|
| 15 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.036518Z"
|
| 16 |
+
},
|
| 17 |
+
"papermill": {
|
| 18 |
+
"duration": 0.030241,
|
| 19 |
+
"end_time": "2021-08-04T16:56:03.263130",
|
| 20 |
+
"exception": false,
|
| 21 |
+
"start_time": "2021-08-04T16:56:03.232889",
|
| 22 |
+
"status": "completed"
|
| 23 |
+
},
|
| 24 |
+
"tags": []
|
| 25 |
+
},
|
| 26 |
+
"outputs": [],
|
| 27 |
+
"source": [
|
| 28 |
+
"import numpy as np\n",
|
| 29 |
+
"import math"
|
| 30 |
+
]
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"cell_type": "code",
|
| 34 |
+
"execution_count": 2,
|
| 35 |
+
"id": "26161f47",
|
| 36 |
+
"metadata": {
|
| 37 |
+
"execution": {
|
| 38 |
+
"iopub.execute_input": "2021-08-04T16:56:03.298104Z",
|
| 39 |
+
"iopub.status.busy": "2021-08-04T16:56:03.297399Z",
|
| 40 |
+
"iopub.status.idle": "2021-08-04T16:56:03.300325Z",
|
| 41 |
+
"shell.execute_reply": "2021-08-04T16:56:03.300795Z",
|
| 42 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.051192Z"
|
| 43 |
+
},
|
| 44 |
+
"papermill": {
|
| 45 |
+
"duration": 0.023173,
|
| 46 |
+
"end_time": "2021-08-04T16:56:03.301010",
|
| 47 |
+
"exception": false,
|
| 48 |
+
"start_time": "2021-08-04T16:56:03.277837",
|
| 49 |
+
"status": "completed"
|
| 50 |
+
},
|
| 51 |
+
"tags": []
|
| 52 |
+
},
|
| 53 |
+
"outputs": [],
|
| 54 |
+
"source": [
|
| 55 |
+
"#simple interest\n",
|
| 56 |
+
"\n",
|
| 57 |
+
"def simple_interest(p, r, t):\n",
|
| 58 |
+
" \n",
|
| 59 |
+
" print('Amount: ', p)\n",
|
| 60 |
+
" print(\"Rate of Interest (Per Annum)\", r)\n",
|
| 61 |
+
" print(\"Time (In Years): \",t)\n",
|
| 62 |
+
" \n",
|
| 63 |
+
" si=(p*r*t)/100\n",
|
| 64 |
+
" \n",
|
| 65 |
+
" a= p+si\n",
|
| 66 |
+
" \n",
|
| 67 |
+
" print(\"Final Amount: \", a)\n",
|
| 68 |
+
" print(\"Simple Interest: \", si)\n",
|
| 69 |
+
" "
|
| 70 |
+
]
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"cell_type": "code",
|
| 74 |
+
"execution_count": 3,
|
| 75 |
+
"id": "c6b24b72",
|
| 76 |
+
"metadata": {
|
| 77 |
+
"execution": {
|
| 78 |
+
"iopub.execute_input": "2021-08-04T16:56:03.335264Z",
|
| 79 |
+
"iopub.status.busy": "2021-08-04T16:56:03.334617Z",
|
| 80 |
+
"iopub.status.idle": "2021-08-04T16:56:03.340135Z",
|
| 81 |
+
"shell.execute_reply": "2021-08-04T16:56:03.339553Z",
|
| 82 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.069054Z"
|
| 83 |
+
},
|
| 84 |
+
"papermill": {
|
| 85 |
+
"duration": 0.02474,
|
| 86 |
+
"end_time": "2021-08-04T16:56:03.340274",
|
| 87 |
+
"exception": false,
|
| 88 |
+
"start_time": "2021-08-04T16:56:03.315534",
|
| 89 |
+
"status": "completed"
|
| 90 |
+
},
|
| 91 |
+
"tags": []
|
| 92 |
+
},
|
| 93 |
+
"outputs": [
|
| 94 |
+
{
|
| 95 |
+
"name": "stdout",
|
| 96 |
+
"output_type": "stream",
|
| 97 |
+
"text": [
|
| 98 |
+
"Amount: 1000\n",
|
| 99 |
+
"Rate of Interest (Per Annum) 5\n",
|
| 100 |
+
"Time (In Years): 3\n",
|
| 101 |
+
"Final Amount: 1150.0\n",
|
| 102 |
+
"Simple Interest: 150.0\n"
|
| 103 |
+
]
|
| 104 |
+
}
|
| 105 |
+
],
|
| 106 |
+
"source": [
|
| 107 |
+
"simple_interest(1000, 5, 3)"
|
| 108 |
+
]
|
| 109 |
+
},
|
| 110 |
+
{
|
| 111 |
+
"cell_type": "code",
|
| 112 |
+
"execution_count": 4,
|
| 113 |
+
"id": "6457fc00",
|
| 114 |
+
"metadata": {
|
| 115 |
+
"execution": {
|
| 116 |
+
"iopub.execute_input": "2021-08-04T16:56:03.375241Z",
|
| 117 |
+
"iopub.status.busy": "2021-08-04T16:56:03.374537Z",
|
| 118 |
+
"iopub.status.idle": "2021-08-04T16:56:03.377755Z",
|
| 119 |
+
"shell.execute_reply": "2021-08-04T16:56:03.377113Z",
|
| 120 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.083030Z"
|
| 121 |
+
},
|
| 122 |
+
"papermill": {
|
| 123 |
+
"duration": 0.023264,
|
| 124 |
+
"end_time": "2021-08-04T16:56:03.377893",
|
| 125 |
+
"exception": false,
|
| 126 |
+
"start_time": "2021-08-04T16:56:03.354629",
|
| 127 |
+
"status": "completed"
|
| 128 |
+
},
|
| 129 |
+
"tags": []
|
| 130 |
+
},
|
| 131 |
+
"outputs": [],
|
| 132 |
+
"source": [
|
| 133 |
+
"#compound interest\n",
|
| 134 |
+
"\n",
|
| 135 |
+
"def compound_interest(p,r,t):\n",
|
| 136 |
+
" \n",
|
| 137 |
+
" print('Amount: ', p)\n",
|
| 138 |
+
" print(\"Rate of Interest (Per Annum)\", r)\n",
|
| 139 |
+
" print(\"Time (In Years): \",t)\n",
|
| 140 |
+
" \n",
|
| 141 |
+
" a= p*((1+r/100)**t)\n",
|
| 142 |
+
" \n",
|
| 143 |
+
" ci= a-p\n",
|
| 144 |
+
" print(\"Final Amount: \", a)\n",
|
| 145 |
+
" print(\"Compound Interest: \", ci)\n",
|
| 146 |
+
"\n"
|
| 147 |
+
]
|
| 148 |
+
},
|
| 149 |
+
{
|
| 150 |
+
"cell_type": "code",
|
| 151 |
+
"execution_count": 5,
|
| 152 |
+
"id": "0a5b93c8",
|
| 153 |
+
"metadata": {
|
| 154 |
+
"execution": {
|
| 155 |
+
"iopub.execute_input": "2021-08-04T16:56:03.411333Z",
|
| 156 |
+
"iopub.status.busy": "2021-08-04T16:56:03.410568Z",
|
| 157 |
+
"iopub.status.idle": "2021-08-04T16:56:03.415792Z",
|
| 158 |
+
"shell.execute_reply": "2021-08-04T16:56:03.415285Z",
|
| 159 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.092953Z"
|
| 160 |
+
},
|
| 161 |
+
"papermill": {
|
| 162 |
+
"duration": 0.023465,
|
| 163 |
+
"end_time": "2021-08-04T16:56:03.415979",
|
| 164 |
+
"exception": false,
|
| 165 |
+
"start_time": "2021-08-04T16:56:03.392514",
|
| 166 |
+
"status": "completed"
|
| 167 |
+
},
|
| 168 |
+
"tags": []
|
| 169 |
+
},
|
| 170 |
+
"outputs": [
|
| 171 |
+
{
|
| 172 |
+
"name": "stdout",
|
| 173 |
+
"output_type": "stream",
|
| 174 |
+
"text": [
|
| 175 |
+
"Amount: 1000\n",
|
| 176 |
+
"Rate of Interest (Per Annum) 10\n",
|
| 177 |
+
"Time (In Years): 2\n",
|
| 178 |
+
"Final Amount: 1210.0000000000002\n",
|
| 179 |
+
"Compound Interest: 210.00000000000023\n"
|
| 180 |
+
]
|
| 181 |
+
}
|
| 182 |
+
],
|
| 183 |
+
"source": [
|
| 184 |
+
"compound_interest(1000,10, 2)"
|
| 185 |
+
]
|
| 186 |
+
},
|
| 187 |
+
{
|
| 188 |
+
"cell_type": "code",
|
| 189 |
+
"execution_count": 6,
|
| 190 |
+
"id": "e0215943",
|
| 191 |
+
"metadata": {
|
| 192 |
+
"execution": {
|
| 193 |
+
"iopub.execute_input": "2021-08-04T16:56:03.450919Z",
|
| 194 |
+
"iopub.status.busy": "2021-08-04T16:56:03.450263Z",
|
| 195 |
+
"iopub.status.idle": "2021-08-04T16:56:03.452808Z",
|
| 196 |
+
"shell.execute_reply": "2021-08-04T16:56:03.452190Z",
|
| 197 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.105865Z"
|
| 198 |
+
},
|
| 199 |
+
"papermill": {
|
| 200 |
+
"duration": 0.022344,
|
| 201 |
+
"end_time": "2021-08-04T16:56:03.452945",
|
| 202 |
+
"exception": false,
|
| 203 |
+
"start_time": "2021-08-04T16:56:03.430601",
|
| 204 |
+
"status": "completed"
|
| 205 |
+
},
|
| 206 |
+
"tags": []
|
| 207 |
+
},
|
| 208 |
+
"outputs": [],
|
| 209 |
+
"source": [
|
| 210 |
+
"# Purchasing power\n",
|
| 211 |
+
"\n",
|
| 212 |
+
"def pur_power(p,r,t):\n",
|
| 213 |
+
" \n",
|
| 214 |
+
" print(\"Initial Amount: \",p)\n",
|
| 215 |
+
" print(\"Annual Inflation Rate: \",r)\n",
|
| 216 |
+
" print(\"Time in years:\", t)\n",
|
| 217 |
+
" \n",
|
| 218 |
+
" a= p* ((100/(100+r))**t)\n",
|
| 219 |
+
" \n",
|
| 220 |
+
" print(\"Final amount after\",t,\"years of inflation: \", a)\n",
|
| 221 |
+
"\n"
|
| 222 |
+
]
|
| 223 |
+
},
|
| 224 |
+
{
|
| 225 |
+
"cell_type": "code",
|
| 226 |
+
"execution_count": 7,
|
| 227 |
+
"id": "e7244c70",
|
| 228 |
+
"metadata": {
|
| 229 |
+
"execution": {
|
| 230 |
+
"iopub.execute_input": "2021-08-04T16:56:03.486770Z",
|
| 231 |
+
"iopub.status.busy": "2021-08-04T16:56:03.486170Z",
|
| 232 |
+
"iopub.status.idle": "2021-08-04T16:56:03.490410Z",
|
| 233 |
+
"shell.execute_reply": "2021-08-04T16:56:03.490935Z",
|
| 234 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.114417Z"
|
| 235 |
+
},
|
| 236 |
+
"papermill": {
|
| 237 |
+
"duration": 0.023426,
|
| 238 |
+
"end_time": "2021-08-04T16:56:03.491127",
|
| 239 |
+
"exception": false,
|
| 240 |
+
"start_time": "2021-08-04T16:56:03.467701",
|
| 241 |
+
"status": "completed"
|
| 242 |
+
},
|
| 243 |
+
"tags": []
|
| 244 |
+
},
|
| 245 |
+
"outputs": [
|
| 246 |
+
{
|
| 247 |
+
"name": "stdout",
|
| 248 |
+
"output_type": "stream",
|
| 249 |
+
"text": [
|
| 250 |
+
"Initial Amount: 10000\n",
|
| 251 |
+
"Annual Inflation Rate: 5\n",
|
| 252 |
+
"Time in years: 10\n",
|
| 253 |
+
"Final amount after 10 years of inflation: 6139.13253540759\n"
|
| 254 |
+
]
|
| 255 |
+
}
|
| 256 |
+
],
|
| 257 |
+
"source": [
|
| 258 |
+
"pur_power(10000,5,10)"
|
| 259 |
+
]
|
| 260 |
+
},
|
| 261 |
+
{
|
| 262 |
+
"cell_type": "code",
|
| 263 |
+
"execution_count": 8,
|
| 264 |
+
"id": "d8fe7e4c",
|
| 265 |
+
"metadata": {
|
| 266 |
+
"execution": {
|
| 267 |
+
"iopub.execute_input": "2021-08-04T16:56:03.524117Z",
|
| 268 |
+
"iopub.status.busy": "2021-08-04T16:56:03.523427Z",
|
| 269 |
+
"iopub.status.idle": "2021-08-04T16:56:03.528494Z",
|
| 270 |
+
"shell.execute_reply": "2021-08-04T16:56:03.529050Z",
|
| 271 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.127841Z"
|
| 272 |
+
},
|
| 273 |
+
"papermill": {
|
| 274 |
+
"duration": 0.023199,
|
| 275 |
+
"end_time": "2021-08-04T16:56:03.529236",
|
| 276 |
+
"exception": false,
|
| 277 |
+
"start_time": "2021-08-04T16:56:03.506037",
|
| 278 |
+
"status": "completed"
|
| 279 |
+
},
|
| 280 |
+
"tags": []
|
| 281 |
+
},
|
| 282 |
+
"outputs": [],
|
| 283 |
+
"source": [
|
| 284 |
+
"#compound annual growth rate\n",
|
| 285 |
+
"\n",
|
| 286 |
+
"def CAGR(p,a, t ):\n",
|
| 287 |
+
" \n",
|
| 288 |
+
" print(\"Initial value of money: \",p)\n",
|
| 289 |
+
" print('Final value of money: ',a)\n",
|
| 290 |
+
" print(\"Time in years: \", t)\n",
|
| 291 |
+
" t_inv=1/t\n",
|
| 292 |
+
" \n",
|
| 293 |
+
" cagr_rate= (((a/p)**t_inv) -1)*100\n",
|
| 294 |
+
" \n",
|
| 295 |
+
" print(\"Compound Annual Growth Rate (CAGR): \", cagr_rate)"
|
| 296 |
+
]
|
| 297 |
+
},
|
| 298 |
+
{
|
| 299 |
+
"cell_type": "code",
|
| 300 |
+
"execution_count": 9,
|
| 301 |
+
"id": "dfc05402",
|
| 302 |
+
"metadata": {
|
| 303 |
+
"execution": {
|
| 304 |
+
"iopub.execute_input": "2021-08-04T16:56:03.562264Z",
|
| 305 |
+
"iopub.status.busy": "2021-08-04T16:56:03.561664Z",
|
| 306 |
+
"iopub.status.idle": "2021-08-04T16:56:03.568147Z",
|
| 307 |
+
"shell.execute_reply": "2021-08-04T16:56:03.568731Z",
|
| 308 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.137561Z"
|
| 309 |
+
},
|
| 310 |
+
"papermill": {
|
| 311 |
+
"duration": 0.024515,
|
| 312 |
+
"end_time": "2021-08-04T16:56:03.568897",
|
| 313 |
+
"exception": false,
|
| 314 |
+
"start_time": "2021-08-04T16:56:03.544382",
|
| 315 |
+
"status": "completed"
|
| 316 |
+
},
|
| 317 |
+
"tags": []
|
| 318 |
+
},
|
| 319 |
+
"outputs": [
|
| 320 |
+
{
|
| 321 |
+
"name": "stdout",
|
| 322 |
+
"output_type": "stream",
|
| 323 |
+
"text": [
|
| 324 |
+
"Initial value of money: 10000\n",
|
| 325 |
+
"Final value of money: 50000\n",
|
| 326 |
+
"Time in years: 10\n",
|
| 327 |
+
"Compound Annual Growth Rate (CAGR): 17.461894308801895\n"
|
| 328 |
+
]
|
| 329 |
+
}
|
| 330 |
+
],
|
| 331 |
+
"source": [
|
| 332 |
+
"CAGR(10000,50000,10 )"
|
| 333 |
+
]
|
| 334 |
+
},
|
| 335 |
+
{
|
| 336 |
+
"cell_type": "code",
|
| 337 |
+
"execution_count": 10,
|
| 338 |
+
"id": "57214aff",
|
| 339 |
+
"metadata": {
|
| 340 |
+
"execution": {
|
| 341 |
+
"iopub.execute_input": "2021-08-04T16:56:03.602576Z",
|
| 342 |
+
"iopub.status.busy": "2021-08-04T16:56:03.601889Z",
|
| 343 |
+
"iopub.status.idle": "2021-08-04T16:56:03.607345Z",
|
| 344 |
+
"shell.execute_reply": "2021-08-04T16:56:03.607826Z",
|
| 345 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.153074Z"
|
| 346 |
+
},
|
| 347 |
+
"papermill": {
|
| 348 |
+
"duration": 0.023762,
|
| 349 |
+
"end_time": "2021-08-04T16:56:03.608017",
|
| 350 |
+
"exception": false,
|
| 351 |
+
"start_time": "2021-08-04T16:56:03.584255",
|
| 352 |
+
"status": "completed"
|
| 353 |
+
},
|
| 354 |
+
"tags": []
|
| 355 |
+
},
|
| 356 |
+
"outputs": [],
|
| 357 |
+
"source": [
|
| 358 |
+
"#monthly EMI calculation\n",
|
| 359 |
+
"\n",
|
| 360 |
+
"def EMI(p,r,n):\n",
|
| 361 |
+
" \n",
|
| 362 |
+
" print(\"Total Loan Amount: \",p)\n",
|
| 363 |
+
" print(\"Rate of Interest: \",r)\n",
|
| 364 |
+
" print(\"Number of installments: \",n)\n",
|
| 365 |
+
" \n",
|
| 366 |
+
" r_mon= r/(12*100)\n",
|
| 367 |
+
" \n",
|
| 368 |
+
" emi = p * r_mon * ((1+r_mon)**n)/((1+r_mon)**n - 1)\n",
|
| 369 |
+
" print(\"EMI for\",n,\"months: \",emi )\n",
|
| 370 |
+
" \n",
|
| 371 |
+
" "
|
| 372 |
+
]
|
| 373 |
+
},
|
| 374 |
+
{
|
| 375 |
+
"cell_type": "code",
|
| 376 |
+
"execution_count": 11,
|
| 377 |
+
"id": "2dae0336",
|
| 378 |
+
"metadata": {
|
| 379 |
+
"execution": {
|
| 380 |
+
"iopub.execute_input": "2021-08-04T16:56:03.641293Z",
|
| 381 |
+
"iopub.status.busy": "2021-08-04T16:56:03.640644Z",
|
| 382 |
+
"iopub.status.idle": "2021-08-04T16:56:03.647216Z",
|
| 383 |
+
"shell.execute_reply": "2021-08-04T16:56:03.646676Z",
|
| 384 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.161814Z"
|
| 385 |
+
},
|
| 386 |
+
"papermill": {
|
| 387 |
+
"duration": 0.024037,
|
| 388 |
+
"end_time": "2021-08-04T16:56:03.647348",
|
| 389 |
+
"exception": false,
|
| 390 |
+
"start_time": "2021-08-04T16:56:03.623311",
|
| 391 |
+
"status": "completed"
|
| 392 |
+
},
|
| 393 |
+
"tags": []
|
| 394 |
+
},
|
| 395 |
+
"outputs": [
|
| 396 |
+
{
|
| 397 |
+
"name": "stdout",
|
| 398 |
+
"output_type": "stream",
|
| 399 |
+
"text": [
|
| 400 |
+
"Total Loan Amount: 500000\n",
|
| 401 |
+
"Rate of Interest: 8\n",
|
| 402 |
+
"Number of installments: 24\n",
|
| 403 |
+
"EMI for 24 months: 22613.645728092295\n"
|
| 404 |
+
]
|
| 405 |
+
}
|
| 406 |
+
],
|
| 407 |
+
"source": [
|
| 408 |
+
"EMI(500000,8, 24)"
|
| 409 |
+
]
|
| 410 |
+
},
|
| 411 |
+
{
|
| 412 |
+
"cell_type": "code",
|
| 413 |
+
"execution_count": 12,
|
| 414 |
+
"id": "94e327c3",
|
| 415 |
+
"metadata": {
|
| 416 |
+
"execution": {
|
| 417 |
+
"iopub.execute_input": "2021-08-04T16:56:03.684168Z",
|
| 418 |
+
"iopub.status.busy": "2021-08-04T16:56:03.683431Z",
|
| 419 |
+
"iopub.status.idle": "2021-08-04T16:56:03.688164Z",
|
| 420 |
+
"shell.execute_reply": "2021-08-04T16:56:03.687562Z",
|
| 421 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.173898Z"
|
| 422 |
+
},
|
| 423 |
+
"papermill": {
|
| 424 |
+
"duration": 0.02543,
|
| 425 |
+
"end_time": "2021-08-04T16:56:03.688298",
|
| 426 |
+
"exception": false,
|
| 427 |
+
"start_time": "2021-08-04T16:56:03.662868",
|
| 428 |
+
"status": "completed"
|
| 429 |
+
},
|
| 430 |
+
"tags": []
|
| 431 |
+
},
|
| 432 |
+
"outputs": [],
|
| 433 |
+
"source": [
|
| 434 |
+
"#doubling time calculation\n",
|
| 435 |
+
"\n",
|
| 436 |
+
"def double(r):\n",
|
| 437 |
+
" \n",
|
| 438 |
+
" print(\"Rate of Interest: \",r)\n",
|
| 439 |
+
" \n",
|
| 440 |
+
" t= math.log(2)/math.log(1+ (r/100))\n",
|
| 441 |
+
" \n",
|
| 442 |
+
" print(\"Time taken in years to double money at\",r,\"percent PA: \", t)"
|
| 443 |
+
]
|
| 444 |
+
},
|
| 445 |
+
{
|
| 446 |
+
"cell_type": "code",
|
| 447 |
+
"execution_count": 13,
|
| 448 |
+
"id": "326459ed",
|
| 449 |
+
"metadata": {
|
| 450 |
+
"execution": {
|
| 451 |
+
"iopub.execute_input": "2021-08-04T16:56:03.725412Z",
|
| 452 |
+
"iopub.status.busy": "2021-08-04T16:56:03.724546Z",
|
| 453 |
+
"iopub.status.idle": "2021-08-04T16:56:03.729688Z",
|
| 454 |
+
"shell.execute_reply": "2021-08-04T16:56:03.728737Z",
|
| 455 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.182115Z"
|
| 456 |
+
},
|
| 457 |
+
"papermill": {
|
| 458 |
+
"duration": 0.025944,
|
| 459 |
+
"end_time": "2021-08-04T16:56:03.729972",
|
| 460 |
+
"exception": false,
|
| 461 |
+
"start_time": "2021-08-04T16:56:03.704028",
|
| 462 |
+
"status": "completed"
|
| 463 |
+
},
|
| 464 |
+
"tags": []
|
| 465 |
+
},
|
| 466 |
+
"outputs": [
|
| 467 |
+
{
|
| 468 |
+
"name": "stdout",
|
| 469 |
+
"output_type": "stream",
|
| 470 |
+
"text": [
|
| 471 |
+
"Rate of Interest: 8\n",
|
| 472 |
+
"Time taken in years to double money at 8 percent PA: 9.006468342000588\n"
|
| 473 |
+
]
|
| 474 |
+
}
|
| 475 |
+
],
|
| 476 |
+
"source": [
|
| 477 |
+
"double(8)"
|
| 478 |
+
]
|
| 479 |
+
},
|
| 480 |
+
{
|
| 481 |
+
"cell_type": "code",
|
| 482 |
+
"execution_count": 14,
|
| 483 |
+
"id": "7bca9548",
|
| 484 |
+
"metadata": {
|
| 485 |
+
"execution": {
|
| 486 |
+
"iopub.execute_input": "2021-08-04T16:56:03.770546Z",
|
| 487 |
+
"iopub.status.busy": "2021-08-04T16:56:03.769593Z",
|
| 488 |
+
"iopub.status.idle": "2021-08-04T16:56:03.772805Z",
|
| 489 |
+
"shell.execute_reply": "2021-08-04T16:56:03.772255Z",
|
| 490 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.195467Z"
|
| 491 |
+
},
|
| 492 |
+
"papermill": {
|
| 493 |
+
"duration": 0.025069,
|
| 494 |
+
"end_time": "2021-08-04T16:56:03.772983",
|
| 495 |
+
"exception": false,
|
| 496 |
+
"start_time": "2021-08-04T16:56:03.747914",
|
| 497 |
+
"status": "completed"
|
| 498 |
+
},
|
| 499 |
+
"tags": []
|
| 500 |
+
},
|
| 501 |
+
"outputs": [],
|
| 502 |
+
"source": [
|
| 503 |
+
"ratio=[0.20, 0.25, 0.35,0.10, 0.10]\n",
|
| 504 |
+
"rates=[7.5, 8.5, 8, 5, 6]\n",
|
| 505 |
+
"\n",
|
| 506 |
+
"\n",
|
| 507 |
+
"def weighted_average(ratio,rates):\n",
|
| 508 |
+
" \n",
|
| 509 |
+
" wa=0\n",
|
| 510 |
+
" \n",
|
| 511 |
+
" for i in range(len(ratio)):\n",
|
| 512 |
+
" \n",
|
| 513 |
+
" wa= wa+ ratio[i]*rates[i]\n",
|
| 514 |
+
" \n",
|
| 515 |
+
" print(\"Weighted Average returns: \",wa)\n",
|
| 516 |
+
" \n"
|
| 517 |
+
]
|
| 518 |
+
},
|
| 519 |
+
{
|
| 520 |
+
"cell_type": "code",
|
| 521 |
+
"execution_count": 15,
|
| 522 |
+
"id": "424d73d7",
|
| 523 |
+
"metadata": {
|
| 524 |
+
"execution": {
|
| 525 |
+
"iopub.execute_input": "2021-08-04T16:56:03.813381Z",
|
| 526 |
+
"iopub.status.busy": "2021-08-04T16:56:03.812475Z",
|
| 527 |
+
"iopub.status.idle": "2021-08-04T16:56:03.815814Z",
|
| 528 |
+
"shell.execute_reply": "2021-08-04T16:56:03.816349Z",
|
| 529 |
+
"shell.execute_reply.started": "2021-08-04T16:54:09.288482Z"
|
| 530 |
+
},
|
| 531 |
+
"papermill": {
|
| 532 |
+
"duration": 0.026139,
|
| 533 |
+
"end_time": "2021-08-04T16:56:03.816525",
|
| 534 |
+
"exception": false,
|
| 535 |
+
"start_time": "2021-08-04T16:56:03.790386",
|
| 536 |
+
"status": "completed"
|
| 537 |
+
},
|
| 538 |
+
"tags": []
|
| 539 |
+
},
|
| 540 |
+
"outputs": [
|
| 541 |
+
{
|
| 542 |
+
"name": "stdout",
|
| 543 |
+
"output_type": "stream",
|
| 544 |
+
"text": [
|
| 545 |
+
"Weighted Average returns: 7.525\n"
|
| 546 |
+
]
|
| 547 |
+
}
|
| 548 |
+
],
|
| 549 |
+
"source": [
|
| 550 |
+
"weighted_average(ratio,rates)"
|
| 551 |
+
]
|
| 552 |
+
},
|
| 553 |
+
{
|
| 554 |
+
"cell_type": "code",
|
| 555 |
+
"execution_count": null,
|
| 556 |
+
"id": "9399fa62",
|
| 557 |
+
"metadata": {
|
| 558 |
+
"papermill": {
|
| 559 |
+
"duration": 0.018136,
|
| 560 |
+
"end_time": "2021-08-04T16:56:03.856114",
|
| 561 |
+
"exception": false,
|
| 562 |
+
"start_time": "2021-08-04T16:56:03.837978",
|
| 563 |
+
"status": "completed"
|
| 564 |
+
},
|
| 565 |
+
"tags": []
|
| 566 |
+
},
|
| 567 |
+
"outputs": [],
|
| 568 |
+
"source": []
|
| 569 |
+
}
|
| 570 |
+
],
|
| 571 |
+
"metadata": {
|
| 572 |
+
"kernelspec": {
|
| 573 |
+
"display_name": "Python 3",
|
| 574 |
+
"language": "python",
|
| 575 |
+
"name": "python3"
|
| 576 |
+
},
|
| 577 |
+
"language_info": {
|
| 578 |
+
"codemirror_mode": {
|
| 579 |
+
"name": "ipython",
|
| 580 |
+
"version": 3
|
| 581 |
+
},
|
| 582 |
+
"file_extension": ".py",
|
| 583 |
+
"mimetype": "text/x-python",
|
| 584 |
+
"name": "python",
|
| 585 |
+
"nbconvert_exporter": "python",
|
| 586 |
+
"pygments_lexer": "ipython3",
|
| 587 |
+
"version": "3.7.10"
|
| 588 |
+
},
|
| 589 |
+
"papermill": {
|
| 590 |
+
"default_parameters": {},
|
| 591 |
+
"duration": 9.573942,
|
| 592 |
+
"end_time": "2021-08-04T16:56:04.492451",
|
| 593 |
+
"environment_variables": {},
|
| 594 |
+
"exception": null,
|
| 595 |
+
"input_path": "__notebook__.ipynb",
|
| 596 |
+
"output_path": "__notebook__.ipynb",
|
| 597 |
+
"parameters": {},
|
| 598 |
+
"start_time": "2021-08-04T16:55:54.918509",
|
| 599 |
+
"version": "2.3.3"
|
| 600 |
+
}
|
| 601 |
+
},
|
| 602 |
+
"nbformat": 4,
|
| 603 |
+
"nbformat_minor": 5
|
| 604 |
+
}
|
cash-flow-statement.xlsx
ADDED
|
Binary file (46.2 kB). View file
|
|
|
dcf-calculator-with-python.ipynb
ADDED
|
@@ -0,0 +1,948 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "code",
|
| 5 |
+
"execution_count": 1,
|
| 6 |
+
"id": "e55a16d9",
|
| 7 |
+
"metadata": {
|
| 8 |
+
"_cell_guid": "3cf6da06-5160-4f02-9ad4-f27a1b3de179",
|
| 9 |
+
"_uuid": "56436ec0-8bc1-44f6-aa15-df9b0b426015",
|
| 10 |
+
"collapsed": false,
|
| 11 |
+
"execution": {
|
| 12 |
+
"iopub.execute_input": "2023-07-09T16:09:44.691443Z",
|
| 13 |
+
"iopub.status.busy": "2023-07-09T16:09:44.690917Z",
|
| 14 |
+
"iopub.status.idle": "2023-07-09T16:09:48.164495Z",
|
| 15 |
+
"shell.execute_reply": "2023-07-09T16:09:48.162449Z"
|
| 16 |
+
},
|
| 17 |
+
"jupyter": {
|
| 18 |
+
"outputs_hidden": false
|
| 19 |
+
},
|
| 20 |
+
"papermill": {
|
| 21 |
+
"duration": 3.482832,
|
| 22 |
+
"end_time": "2023-07-09T16:09:48.166901",
|
| 23 |
+
"exception": true,
|
| 24 |
+
"start_time": "2023-07-09T16:09:44.684069",
|
| 25 |
+
"status": "failed"
|
| 26 |
+
},
|
| 27 |
+
"tags": []
|
| 28 |
+
},
|
| 29 |
+
"outputs": [
|
| 30 |
+
{
|
| 31 |
+
"ename": "FileNotFoundError",
|
| 32 |
+
"evalue": "[Errno 2] No such file or directory: 'RHHBY_Income Statement_NEW_nodatetime.csv'",
|
| 33 |
+
"output_type": "error",
|
| 34 |
+
"traceback": [
|
| 35 |
+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
| 36 |
+
"\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
|
| 37 |
+
"Cell \u001b[0;32mIn[1], line 18\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mseaborn\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mns\u001b[39;00m\n\u001b[1;32m 17\u001b[0m \u001b[38;5;66;03m# Load financial statements data from CSV files\u001b[39;00m\n\u001b[0;32m---> 18\u001b[0m income_statement \u001b[38;5;241m=\u001b[39m \u001b[43mpd\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread_csv\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mRHHBY_Income Statement_NEW_nodatetime.csv\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mheader\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mindex_col\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43musecols\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m2\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m3\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m4\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m5\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241m.\u001b[39mtranspose()\n\u001b[1;32m 19\u001b[0m balance_sheet \u001b[38;5;241m=\u001b[39m pd\u001b[38;5;241m.\u001b[39mread_csv(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mRHHBY_Balance Sheet_NEW_nodatetime.csv\u001b[39m\u001b[38;5;124m'\u001b[39m, header\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m, index_col\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m, usecols\u001b[38;5;241m=\u001b[39m[\u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m2\u001b[39m, \u001b[38;5;241m3\u001b[39m, \u001b[38;5;241m4\u001b[39m, \u001b[38;5;241m5\u001b[39m])\u001b[38;5;241m.\u001b[39mtranspose()\n\u001b[1;32m 20\u001b[0m cash_flow_statement \u001b[38;5;241m=\u001b[39m pd\u001b[38;5;241m.\u001b[39mread_csv(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mRHHBY_Cash Flow_NEW_nodatetime.csv\u001b[39m\u001b[38;5;124m'\u001b[39m, header\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m, index_col\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m, usecols\u001b[38;5;241m=\u001b[39m[\u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m2\u001b[39m, \u001b[38;5;241m3\u001b[39m, \u001b[38;5;241m4\u001b[39m, \u001b[38;5;241m5\u001b[39m])\u001b[38;5;241m.\u001b[39mtranspose()\n",
|
| 38 |
+
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/util/_decorators.py:211\u001b[0m, in \u001b[0;36mdeprecate_kwarg.<locals>._deprecate_kwarg.<locals>.wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 209\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 210\u001b[0m kwargs[new_arg_name] \u001b[38;5;241m=\u001b[39m new_arg_value\n\u001b[0;32m--> 211\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
|
| 39 |
+
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/util/_decorators.py:331\u001b[0m, in \u001b[0;36mdeprecate_nonkeyword_arguments.<locals>.decorate.<locals>.wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 325\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(args) \u001b[38;5;241m>\u001b[39m num_allow_args:\n\u001b[1;32m 326\u001b[0m warnings\u001b[38;5;241m.\u001b[39mwarn(\n\u001b[1;32m 327\u001b[0m msg\u001b[38;5;241m.\u001b[39mformat(arguments\u001b[38;5;241m=\u001b[39m_format_argument_list(allow_args)),\n\u001b[1;32m 328\u001b[0m \u001b[38;5;167;01mFutureWarning\u001b[39;00m,\n\u001b[1;32m 329\u001b[0m stacklevel\u001b[38;5;241m=\u001b[39mfind_stack_level(),\n\u001b[1;32m 330\u001b[0m )\n\u001b[0;32m--> 331\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
|
| 40 |
+
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/io/parsers/readers.py:950\u001b[0m, in \u001b[0;36mread_csv\u001b[0;34m(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, error_bad_lines, warn_bad_lines, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options)\u001b[0m\n\u001b[1;32m 935\u001b[0m kwds_defaults \u001b[38;5;241m=\u001b[39m _refine_defaults_read(\n\u001b[1;32m 936\u001b[0m dialect,\n\u001b[1;32m 937\u001b[0m delimiter,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 946\u001b[0m defaults\u001b[38;5;241m=\u001b[39m{\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdelimiter\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m,\u001b[39m\u001b[38;5;124m\"\u001b[39m},\n\u001b[1;32m 947\u001b[0m )\n\u001b[1;32m 948\u001b[0m kwds\u001b[38;5;241m.\u001b[39mupdate(kwds_defaults)\n\u001b[0;32m--> 950\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_read\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilepath_or_buffer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwds\u001b[49m\u001b[43m)\u001b[49m\n",
|
| 41 |
+
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/io/parsers/readers.py:605\u001b[0m, in \u001b[0;36m_read\u001b[0;34m(filepath_or_buffer, kwds)\u001b[0m\n\u001b[1;32m 602\u001b[0m _validate_names(kwds\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnames\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m))\n\u001b[1;32m 604\u001b[0m \u001b[38;5;66;03m# Create the parser.\u001b[39;00m\n\u001b[0;32m--> 605\u001b[0m parser \u001b[38;5;241m=\u001b[39m \u001b[43mTextFileReader\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilepath_or_buffer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwds\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 607\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m chunksize \u001b[38;5;129;01mor\u001b[39;00m iterator:\n\u001b[1;32m 608\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m parser\n",
|
| 42 |
+
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/io/parsers/readers.py:1442\u001b[0m, in \u001b[0;36mTextFileReader.__init__\u001b[0;34m(self, f, engine, **kwds)\u001b[0m\n\u001b[1;32m 1439\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhas_index_names\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m kwds[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhas_index_names\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m 1441\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles: IOHandles \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m-> 1442\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_engine \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_make_engine\u001b[49m\u001b[43m(\u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mengine\u001b[49m\u001b[43m)\u001b[49m\n",
|
| 43 |
+
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/io/parsers/readers.py:1735\u001b[0m, in \u001b[0;36mTextFileReader._make_engine\u001b[0;34m(self, f, engine)\u001b[0m\n\u001b[1;32m 1733\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m mode:\n\u001b[1;32m 1734\u001b[0m mode \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m-> 1735\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles \u001b[38;5;241m=\u001b[39m \u001b[43mget_handle\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1736\u001b[0m \u001b[43m \u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1737\u001b[0m \u001b[43m \u001b[49m\u001b[43mmode\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1738\u001b[0m \u001b[43m \u001b[49m\u001b[43mencoding\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mencoding\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1739\u001b[0m \u001b[43m \u001b[49m\u001b[43mcompression\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mcompression\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1740\u001b[0m \u001b[43m \u001b[49m\u001b[43mmemory_map\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mmemory_map\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1741\u001b[0m \u001b[43m \u001b[49m\u001b[43mis_text\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_text\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1742\u001b[0m \u001b[43m \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mencoding_errors\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstrict\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1743\u001b[0m \u001b[43m \u001b[49m\u001b[43mstorage_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstorage_options\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1744\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1745\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 1746\u001b[0m f \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles\u001b[38;5;241m.\u001b[39mhandle\n",
|
| 44 |
+
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/io/common.py:856\u001b[0m, in \u001b[0;36mget_handle\u001b[0;34m(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)\u001b[0m\n\u001b[1;32m 851\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(handle, \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 852\u001b[0m \u001b[38;5;66;03m# Check whether the filename is to be opened in binary mode.\u001b[39;00m\n\u001b[1;32m 853\u001b[0m \u001b[38;5;66;03m# Binary mode does not support 'encoding' and 'newline'.\u001b[39;00m\n\u001b[1;32m 854\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m ioargs\u001b[38;5;241m.\u001b[39mencoding \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m ioargs\u001b[38;5;241m.\u001b[39mmode:\n\u001b[1;32m 855\u001b[0m \u001b[38;5;66;03m# Encoding\u001b[39;00m\n\u001b[0;32m--> 856\u001b[0m handle \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\n\u001b[1;32m 857\u001b[0m \u001b[43m \u001b[49m\u001b[43mhandle\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 858\u001b[0m \u001b[43m \u001b[49m\u001b[43mioargs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmode\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 859\u001b[0m \u001b[43m \u001b[49m\u001b[43mencoding\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mioargs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mencoding\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 860\u001b[0m \u001b[43m \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43merrors\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 861\u001b[0m \u001b[43m \u001b[49m\u001b[43mnewline\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 862\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 863\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 864\u001b[0m \u001b[38;5;66;03m# Binary mode\u001b[39;00m\n\u001b[1;32m 865\u001b[0m handle \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mopen\u001b[39m(handle, ioargs\u001b[38;5;241m.\u001b[39mmode)\n",
|
| 45 |
+
"\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'RHHBY_Income Statement_NEW_nodatetime.csv'"
|
| 46 |
+
]
|
| 47 |
+
}
|
| 48 |
+
],
|
| 49 |
+
"source": [
|
| 50 |
+
"# This scripts allow you to upload financial statements in .csv format (e.g., downloaded from Morningstar.com), and automatically estimate the fair price of the company based on a discounted cash flow model. The advantage is that you don't have to manually import all the data into a spreadsheet-based DCF Model, then saving time and reducing the likelihood of making mistakes (which doesn't eliminate completely the possibility of making mistakes). The fair price depend on different variables, such as the WACC you decide (which you can change in the formula). Moreover, the compounded growth of each financial value is calculated based on a weighted average of the last few years, that gives bigger weights to certin year (e.g., in this example it gives smaller weights to the COVID-19 years, because they caused anomalies in the economy.\n",
|
| 51 |
+
"\n",
|
| 52 |
+
"#This script is by no means a predictor and it isn't a magic formula for financial success, it's up to you to change the weights in the weighted average YOY growth, to estimate the WACC, to interpret the results, and to spot any bug in the code. If you find any bug in the code, please let me know, I'll be happy to fix it and improve the code. Moreover, it's impossible to predict the future, and you should be cautious when interpreting the fair price and any other result calculated by this script.\n",
|
| 53 |
+
"\n",
|
| 54 |
+
"#This script uses Roche Holding AG (RHHBY) as an example, and you may have to change the attribute names when importing your own three financial statements, because those attributed may be named differently (e.g., Total Revenue could be named Revenue or have other names).\n",
|
| 55 |
+
"\n",
|
| 56 |
+
"import pandas as pd\r\n",
|
| 57 |
+
"import numpy as np\r\n",
|
| 58 |
+
"import openpyxl\r\n",
|
| 59 |
+
"import matplotlib.pyplot as plt\r\n",
|
| 60 |
+
"import matplotlib.ticker as mtick\r\n",
|
| 61 |
+
"import seaborn as ns\r\n",
|
| 62 |
+
"\r\n",
|
| 63 |
+
"\r\n",
|
| 64 |
+
"\r\n",
|
| 65 |
+
"\r\n",
|
| 66 |
+
"# Load financial statements data from CSV files\r\n",
|
| 67 |
+
"income_statement = pd.read_csv('RHHBY_Income Statement_NEW_nodatetime.csv', header=0, index_col=0, usecols=[0, 1, 2, 3, 4, 5]).transpose()\r\n",
|
| 68 |
+
"balance_sheet = pd.read_csv('RHHBY_Balance Sheet_NEW_nodatetime.csv', header=0, index_col=0, usecols=[0, 1, 2, 3, 4, 5]).transpose()\r\n",
|
| 69 |
+
"cash_flow_statement = pd.read_csv('RHHBY_Cash Flow_NEW_nodatetime.csv', header=0, index_col=0, usecols=[0, 1, 2, 3, 4, 5]).transpose()\r\n",
|
| 70 |
+
"\r\n",
|
| 71 |
+
"print(income_statement.head())\r\n",
|
| 72 |
+
"print(balance_sheet.head())\r\n",
|
| 73 |
+
"print(cash_flow_statement.head())\r\n",
|
| 74 |
+
"\r\n",
|
| 75 |
+
"income_statement.to_csv(\"RHHBY_Income Statement_transposed.csv\", index=True)\r\n",
|
| 76 |
+
"balance_sheet.to_csv(\"RHHBY_Balance Sheet_transposed.csv\", index=True)\r\n",
|
| 77 |
+
"cash_flow_statement.to_csv(\"RHHBY_Cash Flow Statement_transposed.csv\", index=True)\r\n",
|
| 78 |
+
"\r\n",
|
| 79 |
+
"# Define the discount rate (e.g. the weighted average cost of capital)\r\n",
|
| 80 |
+
"discount_rate = 0.2\r\n",
|
| 81 |
+
"\r\n",
|
| 82 |
+
"# Input the number of shares outstanding\r\n",
|
| 83 |
+
"shares_outstanding = 6405000000\r\n",
|
| 84 |
+
"\r\n",
|
| 85 |
+
"# Calculate the net income\r\n",
|
| 86 |
+
"revenue = income_statement['Total Revenue'].iloc[-1]\r\n",
|
| 87 |
+
"cost_of_goods_sold = income_statement['Cost of Revenue'].iloc[-1]\r\n",
|
| 88 |
+
"gross_profit = revenue - cost_of_goods_sold\r\n",
|
| 89 |
+
"\r\n",
|
| 90 |
+
"operating_expenses = income_statement['Operating Income/Expenses'].iloc[-1]\r\n",
|
| 91 |
+
"operating_income = gross_profit - operating_expenses\r\n",
|
| 92 |
+
"\r\n",
|
| 93 |
+
"other_income = income_statement['Other Income/Expense, Operating'].iloc[-1]\r\n",
|
| 94 |
+
"interest_expense = income_statement['Net Interest Income/Expense'].iloc[-1]\r\n",
|
| 95 |
+
"income_before_tax = operating_income + other_income - interest_expense\r\n",
|
| 96 |
+
"\r\n",
|
| 97 |
+
"income_tax = income_statement['Provision for Income Tax'].iloc[-1]\r\n",
|
| 98 |
+
"net_income = income_before_tax - income_tax\r\n",
|
| 99 |
+
"\r\n",
|
| 100 |
+
"print(f\"Net Income is: ${net_income:.2f}\")\r\n",
|
| 101 |
+
"\r\n",
|
| 102 |
+
"#calculate the net income per each year\r\n",
|
| 103 |
+
"revenue_all = income_statement['Total Revenue']\r\n",
|
| 104 |
+
"cost_of_goods_sold_all = income_statement['Cost of Revenue']\r\n",
|
| 105 |
+
"gross_profit_all = revenue_all - cost_of_goods_sold_all\r\n",
|
| 106 |
+
"\r\n",
|
| 107 |
+
"operating_expenses_all = income_statement['Operating Income/Expenses']\r\n",
|
| 108 |
+
"operating_income_all = gross_profit_all - operating_expenses_all\r\n",
|
| 109 |
+
"\r\n",
|
| 110 |
+
"other_income_all = income_statement['Other Income/Expense, Operating']\r\n",
|
| 111 |
+
"interest_expense_all = income_statement['Net Interest Income/Expense']\r\n",
|
| 112 |
+
"income_before_tax_all = operating_income_all + other_income_all - interest_expense_all\r\n",
|
| 113 |
+
"\r\n",
|
| 114 |
+
"income_tax_all = income_statement['Provision for Income Tax']\r\n",
|
| 115 |
+
"net_income_all = income_before_tax_all - income_tax_all\r\n",
|
| 116 |
+
"\r\n",
|
| 117 |
+
"print(\"Net Income for each year:\")\r\n",
|
| 118 |
+
"print(net_income_all)\r\n",
|
| 119 |
+
"\r\n",
|
| 120 |
+
"\r\n",
|
| 121 |
+
"\r\n",
|
| 122 |
+
"# Perform calculations to derive free cash flow\r\n",
|
| 123 |
+
"capital_expenditures = cash_flow_statement['Purchase/Sale and Disposal of Property, Plant and Equipment, Net'].iloc[-1]\r\n",
|
| 124 |
+
"\r\n",
|
| 125 |
+
"# Calculate change in working capital\r\n",
|
| 126 |
+
"current_assets = balance_sheet['Total Current Assets'].iloc[-1]\r\n",
|
| 127 |
+
"current_liabilities = balance_sheet['Total Current Liabilities'].iloc[-1]\r\n",
|
| 128 |
+
"working_capital = current_assets - current_liabilities\r\n",
|
| 129 |
+
"print(\"The present working capital is: \")\r\n",
|
| 130 |
+
"print(working_capital)\r\n",
|
| 131 |
+
"\r\n",
|
| 132 |
+
"# Initialize an empty list to store historical working capital values\r\n",
|
| 133 |
+
"historical_working_capital = []\r\n",
|
| 134 |
+
"\r\n",
|
| 135 |
+
"# Iterate over the rows of the balance_sheet DataFrame\r\n",
|
| 136 |
+
"for index, row in balance_sheet.iterrows():\r\n",
|
| 137 |
+
" current_assets = row['Total Current Assets']\r\n",
|
| 138 |
+
" current_liabilities = row['Total Current Liabilities']\r\n",
|
| 139 |
+
" working_capital = current_assets - current_liabilities\r\n",
|
| 140 |
+
" historical_working_capital.append(working_capital)\r\n",
|
| 141 |
+
"\r\n",
|
| 142 |
+
"# Convert the list to a NumPy array for further processing if needed\r\n",
|
| 143 |
+
"historical_working_capital = np.array(historical_working_capital)\r\n",
|
| 144 |
+
"\r\n",
|
| 145 |
+
"\r\n",
|
| 146 |
+
"current_assets_prev = balance_sheet['Total Current Assets'].iloc[-2]\r\n",
|
| 147 |
+
"\r\n",
|
| 148 |
+
"current_liabilities_prev = balance_sheet['Total Current Liabilities'].iloc[-2]\r\n",
|
| 149 |
+
"change_in_working_capital = current_assets - current_assets_prev + current_liabilities_prev - current_liabilities\r\n",
|
| 150 |
+
"\r\n",
|
| 151 |
+
"current_assets_prev = balance_sheet['Total Current Assets'].iloc[-2]\r\n",
|
| 152 |
+
"\r\n",
|
| 153 |
+
"depreciation_amortization = cash_flow_statement['Depreciation, Amortization and Depletion, Non-Cash Adjustment'].iloc[-1]\r\n",
|
| 154 |
+
"\r\n",
|
| 155 |
+
"free_cash_flow = net_income + depreciation_amortization - capital_expenditures - change_in_working_capital\r\n",
|
| 156 |
+
"\r\n",
|
| 157 |
+
"\r\n",
|
| 158 |
+
"\r\n",
|
| 159 |
+
"\r\n",
|
| 160 |
+
"\r\n",
|
| 161 |
+
"#-----------------------------------------------------------------------------------------------------------\r\n",
|
| 162 |
+
"#WACC #let's not use it for the moment\r\n",
|
| 163 |
+
"\r\n",
|
| 164 |
+
"# Get the required values\r\n",
|
| 165 |
+
"equity = balance_sheet[\"Total Equity\"]\r\n",
|
| 166 |
+
"debt = balance_sheet[\"Total Liabilities\"]\r\n",
|
| 167 |
+
"assets = balance_sheet[\"Total Assets\"]\r\n",
|
| 168 |
+
"interest_expense = balance_sheet[\"Interest Payable, Current\"]\r\n",
|
| 169 |
+
"\r\n",
|
| 170 |
+
"risk_free_rate = 0.0128\r\n",
|
| 171 |
+
"market_risk_premium = 0.0580\r\n",
|
| 172 |
+
"levered_beta = 0.78\r\n",
|
| 173 |
+
"size_premium = 0.017\r\n",
|
| 174 |
+
"\r\n",
|
| 175 |
+
"# Calculate #these numbers are random and should be calculated properly\r\n",
|
| 176 |
+
"cost_of_equity = risk_free_rate + (market_risk_premium*levered_beta) + size_premium\r\n",
|
| 177 |
+
"cost_of_debt = interest_expense / debt\r\n",
|
| 178 |
+
"tax_rate = 0.085\r\n",
|
| 179 |
+
"\r\n",
|
| 180 |
+
"debt_to_equity_ratio = debt / equity\r\n",
|
| 181 |
+
"equity_weight = equity / (equity + debt)\r\n",
|
| 182 |
+
"debt_weight = debt / (equity + debt)\r\n",
|
| 183 |
+
"after_tax_cost_of_debt = cost_of_debt * (1 - tax_rate)\r\n",
|
| 184 |
+
"\r\n",
|
| 185 |
+
"WACC = equity_weight * cost_of_equity + debt_weight * after_tax_cost_of_debt\r\n",
|
| 186 |
+
"print(\"The WACC is: \")\r\n",
|
| 187 |
+
"print(WACC)\r\n",
|
| 188 |
+
"#------------------------------------------------------------------------------------------------------------------------------\r\n",
|
| 189 |
+
"#\"\"\"\r\n",
|
| 190 |
+
"#Average growth method\r\n",
|
| 191 |
+
"#Historic Growth\r\n",
|
| 192 |
+
"# Define the number of years for which we want to calculate YoY growth\r\n",
|
| 193 |
+
"num_years = 5\r\n",
|
| 194 |
+
"# Define the number of years for which we'll be projecting cash flows\r\n",
|
| 195 |
+
"projection_years = 5\r\n",
|
| 196 |
+
"\r\n",
|
| 197 |
+
"# Define the weights for each year\r\n",
|
| 198 |
+
"#weights_a = np.array([0.20, 0.20, 0.25, 0.15, 0.15])\r\n",
|
| 199 |
+
"weights_a = np.array([0.30, 0.30, 0.20, 0.20])\r\n",
|
| 200 |
+
"\r\n",
|
| 201 |
+
"#Total revenue\r\n",
|
| 202 |
+
"# Calculate the YoY growth rate for each year\r\n",
|
| 203 |
+
"revenue_history = income_statement['Total Revenue'][-num_years:]\r\n",
|
| 204 |
+
"revenue_yoy_growth = [(revenue_history.iloc[i] - revenue_history.iloc[i - 1]) / revenue_history.iloc[i - 1] for i in range(1, num_years)]\r\n",
|
| 205 |
+
"\r\n",
|
| 206 |
+
"# Calculate the weighted average YoY growth rate\r\n",
|
| 207 |
+
"revenue_weighted_average_yoy_growth = sum([revenue_yoy_growth[i] * weights_a[i] for i in range(num_years-1)]) / sum(weights_a)\r\n",
|
| 208 |
+
"print(f\"The weighted average YoY growth rate for the revenue over the past {num_years} years is: {revenue_weighted_average_yoy_growth:.2%}\")\r\n",
|
| 209 |
+
"\r\n",
|
| 210 |
+
"# Predict future growth based on the weighted average YoY growth rate\r\n",
|
| 211 |
+
"projected_revenue = [revenue_history.iloc[-1] * (1 + revenue_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 212 |
+
"\r\n",
|
| 213 |
+
"#Cost of revenue\r\n",
|
| 214 |
+
"# Calculate the YoY growth rate for each year\r\n",
|
| 215 |
+
"cost_of_revenue_history = income_statement['Cost of Revenue'][-num_years:]\r\n",
|
| 216 |
+
"cost_of_revenue_yoy_growth = [(cost_of_revenue_history.iloc[i] - cost_of_revenue_history.iloc[i - 1]) / cost_of_revenue_history.iloc[i - 1] for i in range(1, num_years)]\r\n",
|
| 217 |
+
"#cost_of_revenue_yoy_growth.append(cost_of_revenue_yoy_growth[-1]) # Add the growth rate for the projected year\r\n",
|
| 218 |
+
"print(f\"The YoY growth rate for the cost of revenue over the past {num_years} years is: {cost_of_revenue_yoy_growth:}\")\r\n",
|
| 219 |
+
"\r\n",
|
| 220 |
+
"# Calculate the weighted average YoY growth rate\r\n",
|
| 221 |
+
"cost_of_revenue_weighted_average_yoy_growth = sum([cost_of_revenue_yoy_growth[i] * weights_a[i] for i in range(num_years-1)]) / sum(weights_a)\r\n",
|
| 222 |
+
"print(f\"The weighted average YoY growth rate for the revenue over the past {num_years} years is: {cost_of_revenue_weighted_average_yoy_growth:.2%}\")\r\n",
|
| 223 |
+
"\r\n",
|
| 224 |
+
"# Growth Projection\r\n",
|
| 225 |
+
"projected_cost_of_revenue = [cost_of_goods_sold * (1 + cost_of_revenue_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 226 |
+
"\r\n",
|
| 227 |
+
"#Operating expenses\r\n",
|
| 228 |
+
"# Calculate the YoY growth rate for each year\r\n",
|
| 229 |
+
"operating_expenses_history = income_statement['Operating Income/Expenses'][-num_years:]\r\n",
|
| 230 |
+
"operating_expenses_yoy_growth = [(operating_expenses_history.iloc[i] - operating_expenses_history.iloc[i - 1]) / operating_expenses_history.iloc[i - 1] for i in range(1, num_years)]\r\n",
|
| 231 |
+
"#operating_expenses_yoy_growth.append(operating_expenses_yoy_growth[-1]) # Add the growth rate for the projected year\r\n",
|
| 232 |
+
"print(f\"The YoY growth rate for the operating expenses over the past {num_years} years is: {operating_expenses_yoy_growth:}\")\r\n",
|
| 233 |
+
"\r\n",
|
| 234 |
+
"# Calculate the weighted average YoY growth rate\r\n",
|
| 235 |
+
"operating_expenses_weighted_average_yoy_growth = sum([operating_expenses_yoy_growth[i] * weights_a[i] for i in range(num_years-1)]) / sum(weights_a)\r\n",
|
| 236 |
+
"print(f\"The weighted average YoY growth rate for the operating expenses over the past {num_years} years is: {operating_expenses_weighted_average_yoy_growth:.2%}\")\r\n",
|
| 237 |
+
"\r\n",
|
| 238 |
+
"# Growth Projection\r\n",
|
| 239 |
+
"projected_operating_expenses = [operating_expenses * (1 + operating_expenses_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 240 |
+
"\r\n",
|
| 241 |
+
"# Other Income\r\n",
|
| 242 |
+
"# Calculate the YoY growth rate for each year\r\n",
|
| 243 |
+
"other_income_history = income_statement['Other Income/Expense, Operating'][-num_years:]\r\n",
|
| 244 |
+
"other_income_yoy_growth = [(other_income_history.iloc[i] - other_income_history.iloc[i - 1]) / other_income_history.iloc[i - 1] for i in range(1, num_years)]\r\n",
|
| 245 |
+
"#other_income_yoy_growth.append(other_income_yoy_growth[-1]) # Add the growth rate for the projected year\r\n",
|
| 246 |
+
"print(f\"The YoY growth rate for the other income over the past {num_years} years is: {other_income_yoy_growth:}\")\r\n",
|
| 247 |
+
"\r\n",
|
| 248 |
+
"# Calculate the weighted average YoY growth rate\r\n",
|
| 249 |
+
"other_income_weighted_average_yoy_growth = sum([other_income_yoy_growth[i] * weights_a[i] for i in range(num_years-1)]) / sum(weights_a)\r\n",
|
| 250 |
+
"print(f\"The weighted average YoY growth rate for the other income over the past {num_years} years is: {other_income_weighted_average_yoy_growth:.2%}\")\r\n",
|
| 251 |
+
"\r\n",
|
| 252 |
+
"# Growth Projection\r\n",
|
| 253 |
+
"projected_other_income = [other_income * (1 + other_income_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 254 |
+
"\r\n",
|
| 255 |
+
"# Interest Expense\r\n",
|
| 256 |
+
"# Calculate the YoY growth rate for each year\r\n",
|
| 257 |
+
"interest_expense_history = income_statement['Net Interest Income/Expense'][-num_years:]\r\n",
|
| 258 |
+
"interest_expense_yoy_growth = [(interest_expense_history.iloc[i] - interest_expense_history.iloc[i - 1]) / interest_expense_history.iloc[i - 1] for i in range(1, num_years)]\r\n",
|
| 259 |
+
"#interest_expense_yoy_growth.append(interest_expense_yoy_growth[-1]) # Add the growth rate for the projected year\r\n",
|
| 260 |
+
"print(f\"The YoY growth rate for interest expense over the past {num_years} years is: {interest_expense_yoy_growth:}\")\r\n",
|
| 261 |
+
"\r\n",
|
| 262 |
+
"# Calculate the weighted average YoY growth rate\r\n",
|
| 263 |
+
"interest_expense_weighted_average_yoy_growth = sum([interest_expense_yoy_growth[i] * weights_a[i] for i in range(num_years-1)]) / sum(weights_a)\r\n",
|
| 264 |
+
"print(f\"The weighted average YoY growth rate for interest expense over the past {num_years} years is: {interest_expense_weighted_average_yoy_growth:.2%}\")\r\n",
|
| 265 |
+
"\r\n",
|
| 266 |
+
"# Growth Projection\r\n",
|
| 267 |
+
"projected_interest_expense = [interest_expense * (1 + interest_expense_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 268 |
+
"\r\n",
|
| 269 |
+
"# Income Tax\r\n",
|
| 270 |
+
"# Calculate the YoY growth rate for each year\r\n",
|
| 271 |
+
"income_tax_history = income_statement['Provision for Income Tax'][-num_years:]\r\n",
|
| 272 |
+
"income_tax_yoy_growth = [(income_tax_history.iloc[i] - income_tax_history.iloc[i - 1]) / income_tax_history.iloc[i - 1] for i in range(1, num_years)]\r\n",
|
| 273 |
+
"#income_tax_yoy_growth.append(income_tax_yoy_growth[-1]) # Add the growth rate for the projected year\r\n",
|
| 274 |
+
"print(f\"The YoY growth rate for income tax over the past {num_years} years is: {income_tax_yoy_growth}\")\r\n",
|
| 275 |
+
"\r\n",
|
| 276 |
+
"# Calculate the weighted average YoY growth rate\r\n",
|
| 277 |
+
"income_tax_average_yoy_growth = sum([income_tax_yoy_growth[i] * weights_a[i] for i in range(num_years-1)]) / sum(weights_a)\r\n",
|
| 278 |
+
"print(f\"The weighted average YoY growth rate for income tax over the past {num_years} years is: {income_tax_average_yoy_growth:.2%}\")\r\n",
|
| 279 |
+
"\r\n",
|
| 280 |
+
"# Growth Projection\r\n",
|
| 281 |
+
"projected_income_tax = [income_tax * (1 + income_tax_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 282 |
+
"\r\n",
|
| 283 |
+
"\r\n",
|
| 284 |
+
"#capex\r\n",
|
| 285 |
+
"# Calculate the YoY growth rate for each year\r\n",
|
| 286 |
+
"capex_history = cash_flow_statement['Purchase/Sale and Disposal of Property, Plant and Equipment, Net'][-num_years:]\r\n",
|
| 287 |
+
"capex_yoy_growth = [(capex_history.iloc[i] - capex_history.iloc[i - 1]) / capex_history.iloc[i - 1] for i in range(1, num_years)]\r\n",
|
| 288 |
+
"#capex_yoy_growth.append(capex_yoy_growth[-1]) # Add the growth rate for the projected year\r\n",
|
| 289 |
+
"print(f\"The YoY growth rate for capital expenditures over the past {num_years} years is: {capex_yoy_growth}\")\r\n",
|
| 290 |
+
"\r\n",
|
| 291 |
+
"# Calculate the weighted average YoY growth rate\r\n",
|
| 292 |
+
"capex_weighted_average_yoy_growth = sum([capex_yoy_growth[i] * weights_a[i] for i in range(num_years-1)]) / sum(weights_a)\r\n",
|
| 293 |
+
"print(f\"The weighted average YoY growth rate for capital expenditures over the past {num_years} years is: {capex_weighted_average_yoy_growth:.2%}\")\r\n",
|
| 294 |
+
"\r\n",
|
| 295 |
+
"# Growth Projection\r\n",
|
| 296 |
+
"projected_capex = [capital_expenditures * (1 + capex_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 297 |
+
"\r\n",
|
| 298 |
+
"\r\n",
|
| 299 |
+
"# Current assets\r\n",
|
| 300 |
+
"# Current assets\r\n",
|
| 301 |
+
"# Calculate the YoY growth rate for each year\r\n",
|
| 302 |
+
"current_assets_history = balance_sheet['Total Current Assets'][-num_years:]\r\n",
|
| 303 |
+
"current_assets_yoy_growth = [(current_assets_history.iloc[i] - current_assets_history.iloc[i - 1]) / current_assets_history.iloc[i - 1] for i in range(1, num_years)]\r\n",
|
| 304 |
+
"#current_assets_yoy_growth.append(current_assets_yoy_growth[-1]) # Add the growth rate for the projected year\r\n",
|
| 305 |
+
"print(f\"The YoY growth rate for current assets over the past {num_years} years is: {current_assets_yoy_growth}\")\r\n",
|
| 306 |
+
"\r\n",
|
| 307 |
+
"# Calculate the weighted average YoY growth rate\r\n",
|
| 308 |
+
"weights_a = [1 / num_years] * num_years # Equal weights_a for each year\r\n",
|
| 309 |
+
"current_assets_weighted_average_yoy_growth = sum([current_assets_yoy_growth[i] * weights_a[i] for i in range(num_years-1)]) / sum(weights_a)\r\n",
|
| 310 |
+
"print(f\"The weighted average YoY growth rate for current assets over the past {num_years} years is: {current_assets_weighted_average_yoy_growth:.2%}\")\r\n",
|
| 311 |
+
"\r\n",
|
| 312 |
+
"# Growth Projection\r\n",
|
| 313 |
+
"projected_current_assets = [current_assets * (1 + current_assets_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 314 |
+
"\r\n",
|
| 315 |
+
"# Current Liabilities\r\n",
|
| 316 |
+
"# Calculate the YoY growth rate for each year\r\n",
|
| 317 |
+
"current_liabilities_history = balance_sheet['Total Current Liabilities'][-num_years:]\r\n",
|
| 318 |
+
"current_liabilities_yoy_growth = [(current_liabilities_history.iloc[i] - current_liabilities_history.iloc[i - 1]) / current_liabilities_history.iloc[i - 1] for i in range(1, num_years)]\r\n",
|
| 319 |
+
"#current_liabilities_yoy_growth.append(current_liabilities_yoy_growth[-1]) # Add the growth rate for the projected year\r\n",
|
| 320 |
+
"print(f\"The YoY growth rate for current liabilities over the past {num_years} years is: {current_liabilities_yoy_growth}\")\r\n",
|
| 321 |
+
"\r\n",
|
| 322 |
+
"# Calculate the weighted average YoY growth rate\r\n",
|
| 323 |
+
"current_liabilities_weighted_average_yoy_growth = sum([current_liabilities_yoy_growth[i] * weights_a[i] for i in range(num_years-1)]) / sum(weights_a)\r\n",
|
| 324 |
+
"print(f\"The weighted average YoY growth rate for current liabilities over the past {num_years} years is: {current_liabilities_weighted_average_yoy_growth:.2%}\")\r\n",
|
| 325 |
+
"\r\n",
|
| 326 |
+
"# Growth Projection\r\n",
|
| 327 |
+
"projected_current_liabilities = [current_liabilities * (1 + current_liabilities_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 328 |
+
"\r\n",
|
| 329 |
+
"#depreciation_amortization\r\n",
|
| 330 |
+
"# Depreciation & Amortization\r\n",
|
| 331 |
+
"# Calculate the YoY growth rate for each year\r\n",
|
| 332 |
+
"depreciation_history = cash_flow_statement['Depreciation, Amortization and Depletion, Non-Cash Adjustment'][-num_years:]\r\n",
|
| 333 |
+
"depreciation_yoy_growth = [(depreciation_history.iloc[i] - depreciation_history.iloc[i - 1]) / depreciation_history.iloc[i - 1] for i in range(1, num_years)]\r\n",
|
| 334 |
+
"#depreciation_yoy_growth.append(depreciation_yoy_growth[-1]) # Add the growth rate for the projected year\r\n",
|
| 335 |
+
"print(f\"The YoY growth rate for Depreciation & Amortization over the past {num_years} years is: {depreciation_yoy_growth}\")\r\n",
|
| 336 |
+
"\r\n",
|
| 337 |
+
"# Calculate the weighted average YoY growth rate\r\n",
|
| 338 |
+
"depreciation_weighted_average_yoy_growth = sum([depreciation_yoy_growth[i] * weights_a[i] for i in range(num_years-1)]) / sum(weights_a)\r\n",
|
| 339 |
+
"print(f\"The weighted average YoY growth rate for Depreciation & Amortization over the past {num_years} years is: {depreciation_weighted_average_yoy_growth:.2%}\")\r\n",
|
| 340 |
+
"\r\n",
|
| 341 |
+
"# Growth Projection\r\n",
|
| 342 |
+
"projected_depreciation_amortization = [depreciation_amortization * (1 + depreciation_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 343 |
+
"\r\n",
|
| 344 |
+
"#Change in working capital\r\n",
|
| 345 |
+
"# Change in working capital\r\n",
|
| 346 |
+
"# Calculate the YoY growth rate for each year\r\n",
|
| 347 |
+
"working_capital_history = [balance_sheet['Total Current Assets'].iloc[-(i+1)] - balance_sheet['Total Current Liabilities'].iloc[-(i+1)] for i in range(num_years)]\r\n",
|
| 348 |
+
"working_capital_yoy_growth = [(working_capital_history[i] - working_capital_history[i - 1]) / working_capital_history[i - 1] for i in range(1, num_years)]\r\n",
|
| 349 |
+
"print(f\"The YoY growth rate for working capital over the past {num_years} years is: {working_capital_yoy_growth}\")\r\n",
|
| 350 |
+
"\r\n",
|
| 351 |
+
"# Calculate the weighted average YoY growth rate\r\n",
|
| 352 |
+
"working_capital_weights_a = [weights_a[i] + weights_a[i+1] for i in range(num_years-1)] #why? Replace when you reduce the weights_a array from 5 to 4 numbers\r\n",
|
| 353 |
+
"working_capital_weighted_average_yoy_growth = sum([working_capital_yoy_growth[i] * working_capital_weights_a[i] for i in range(num_years-1)]) / sum(working_capital_weights_a)\r\n",
|
| 354 |
+
"print(f\"The weighted average YoY growth rate for working capital over the past {num_years} years is: {working_capital_weighted_average_yoy_growth:.2%}\")\r\n",
|
| 355 |
+
"\r\n",
|
| 356 |
+
"# Growth Projection\r\n",
|
| 357 |
+
"projected_working_capital = [working_capital * (1 + working_capital_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 358 |
+
"\r\n",
|
| 359 |
+
"#net income (trial)\r\n",
|
| 360 |
+
"#net_income_yoy_growth = revenue_yoy_growth - cost_of_revenue_yoy_growth - operating_expenses_yoy_growth + other_income_yoy_growth - interest_expense_yoy_growth - income_tax_yoy_growth\r\n",
|
| 361 |
+
"#print(net_income_yoy_growth)\r\n",
|
| 362 |
+
"\r\n",
|
| 363 |
+
"# Create arrays for projected values\r\n",
|
| 364 |
+
"p_revenues = []\r\n",
|
| 365 |
+
"p_cost_of_goods_solds = []\r\n",
|
| 366 |
+
"p_gross_profits = []\r\n",
|
| 367 |
+
"p_operating_expenseses = []\r\n",
|
| 368 |
+
"p_operating_incomes = []\r\n",
|
| 369 |
+
"p_other_incomes = []\r\n",
|
| 370 |
+
"p_interest_expenses = []\r\n",
|
| 371 |
+
"p_income_before_taxes = []\r\n",
|
| 372 |
+
"p_income_taxes = []\r\n",
|
| 373 |
+
"p_net_incomes = []\r\n",
|
| 374 |
+
"p_current_assetses = []\r\n",
|
| 375 |
+
"p_current_liabilitiess = []\r\n",
|
| 376 |
+
"p_working_capitals = []\r\n",
|
| 377 |
+
"p_capexes = []\r\n",
|
| 378 |
+
"p_depreciations_amortizations = []\r\n",
|
| 379 |
+
"\r\n",
|
| 380 |
+
"# Calculate projected values for each year and append to arrays\r\n",
|
| 381 |
+
"for i in range(1, projection_years + 1):\r\n",
|
| 382 |
+
" #p_revenue = revenue * (1 + revenue_average_yoy_growth) ** i\r\n",
|
| 383 |
+
" p_revenue = revenue * (1 + revenue_weighted_average_yoy_growth) ** i\r\n",
|
| 384 |
+
" p_cost_of_goods_sold = cost_of_goods_sold * (1 + cost_of_revenue_weighted_average_yoy_growth) ** i\r\n",
|
| 385 |
+
" p_gross_profit = p_revenue - p_cost_of_goods_sold\r\n",
|
| 386 |
+
" p_operating_expenses = operating_expenses * (1 + operating_expenses_weighted_average_yoy_growth) ** i\r\n",
|
| 387 |
+
" p_operating_income = p_gross_profit - p_operating_expenses\r\n",
|
| 388 |
+
" p_other_income = other_income * (1 + other_income_weighted_average_yoy_growth) ** i\r\n",
|
| 389 |
+
" p_interest_expense = interest_expense * (1 + interest_expense_weighted_average_yoy_growth) ** i\r\n",
|
| 390 |
+
" p_income_before_tax = p_operating_income + p_other_income - p_interest_expense\r\n",
|
| 391 |
+
" p_income_tax = income_tax * (1 + income_tax_average_yoy_growth) ** i\r\n",
|
| 392 |
+
" #p_net_income = p_income_before_tax - p_income_tax\r\n",
|
| 393 |
+
" p_current_assets = current_assets * (1 + current_assets_weighted_average_yoy_growth) ** i\r\n",
|
| 394 |
+
" p_current_liabilities = current_liabilities * (1 + current_liabilities_weighted_average_yoy_growth) ** i\r\n",
|
| 395 |
+
" p_working_capital = p_current_assets - p_current_liabilities\r\n",
|
| 396 |
+
" p_capex = capital_expenditures * (1+ capex_weighted_average_yoy_growth) ** i\r\n",
|
| 397 |
+
" p_depreciation_amortization = depreciation_amortization * (depreciation_weighted_average_yoy_growth) **i\r\n",
|
| 398 |
+
"\r\n",
|
| 399 |
+
" # Append values to arrays\r\n",
|
| 400 |
+
" p_revenues.append(p_revenue)\r\n",
|
| 401 |
+
" p_cost_of_goods_solds.append(p_cost_of_goods_sold)\r\n",
|
| 402 |
+
" p_gross_profits.append(p_gross_profit)\r\n",
|
| 403 |
+
" p_operating_expenseses.append(p_operating_expenses)\r\n",
|
| 404 |
+
" p_operating_incomes.append(p_operating_income)\r\n",
|
| 405 |
+
" p_other_incomes.append(p_other_income)\r\n",
|
| 406 |
+
" p_interest_expenses.append(p_interest_expense)\r\n",
|
| 407 |
+
" p_income_before_taxes.append(p_income_before_tax)\r\n",
|
| 408 |
+
" p_income_taxes.append(p_income_tax)\r\n",
|
| 409 |
+
" #p_net_incomes.append(p_net_income)\r\n",
|
| 410 |
+
" p_current_assetses.append(p_current_assets)\r\n",
|
| 411 |
+
" p_current_liabilitiess.append(p_current_liabilities)\r\n",
|
| 412 |
+
" p_working_capitals.append(p_working_capital)\r\n",
|
| 413 |
+
" p_capexes.append(p_capex)\r\n",
|
| 414 |
+
" p_depreciations_amortizations.append(p_depreciation_amortization)\r\n",
|
| 415 |
+
"\r\n",
|
| 416 |
+
"print(\"The projected revenue is: \")\r\n",
|
| 417 |
+
"print(p_revenues)\r\n",
|
| 418 |
+
"print(\"The projected cost of revenue is: \")\r\n",
|
| 419 |
+
"print(p_cost_of_goods_solds)\r\n",
|
| 420 |
+
"print(\"The projected gross profit is: \")\r\n",
|
| 421 |
+
"print(p_gross_profits)\r\n",
|
| 422 |
+
"print(\"The projected operating expenses is: \")\r\n",
|
| 423 |
+
"print(p_operating_expenseses)\r\n",
|
| 424 |
+
"print(\"The projected operating income is: \")\r\n",
|
| 425 |
+
"print(p_operating_incomes)\r\n",
|
| 426 |
+
"print(\"The projected other income is: \")\r\n",
|
| 427 |
+
"print(p_other_incomes)\r\n",
|
| 428 |
+
"print(\"The projected interest expenses is: \")\r\n",
|
| 429 |
+
"print(p_interest_expenses)\r\n",
|
| 430 |
+
"print(\"The projected income before tax is: \")\r\n",
|
| 431 |
+
"print(p_income_before_taxes)\r\n",
|
| 432 |
+
"print(\"The projected income tax is: \")\r\n",
|
| 433 |
+
"print(p_income_taxes)\r\n",
|
| 434 |
+
"#print(\"The projected operating net income is: \")\r\n",
|
| 435 |
+
"#print(p_net_incomes)\r\n",
|
| 436 |
+
"print(\"The projected current assets is: \")\r\n",
|
| 437 |
+
"print(p_current_assetses)\r\n",
|
| 438 |
+
"print(\"The projected current liabilities is: \")\r\n",
|
| 439 |
+
"print(p_current_liabilitiess)\r\n",
|
| 440 |
+
"print(\"The projected working capital is: \")\r\n",
|
| 441 |
+
"print(p_working_capitals)\r\n",
|
| 442 |
+
"print(\"The projected capex is: \")\r\n",
|
| 443 |
+
"print(p_capex)\r\n",
|
| 444 |
+
"print(\"The projected deprecation and amortization is: \")\r\n",
|
| 445 |
+
"print(p_depreciation_amortization)\r\n",
|
| 446 |
+
"\r\n",
|
| 447 |
+
"# Calculate net income for each year in the DataFrame\r\n",
|
| 448 |
+
"net_income_array = []\r\n",
|
| 449 |
+
"cash_inflows_array = []\r\n",
|
| 450 |
+
"cash_outflows_array = []\r\n",
|
| 451 |
+
"for i, row in income_statement.iterrows():\r\n",
|
| 452 |
+
" revenue = row['Total Revenue']\r\n",
|
| 453 |
+
" cost_of_goods_sold = row['Cost of Revenue']\r\n",
|
| 454 |
+
" operating_expenses = row['Operating Income/Expenses']\r\n",
|
| 455 |
+
" other_income = row['Other Income/Expense, Operating']\r\n",
|
| 456 |
+
" net_interest_expense_income = row['Net Interest Income/Expense']\r\n",
|
| 457 |
+
" interest_expense = row['Interest Expense Net of Capitalized Interest']\r\n",
|
| 458 |
+
" interest_income = row['Interest Income']\r\n",
|
| 459 |
+
" income_tax = row['Provision for Income Tax']\r\n",
|
| 460 |
+
"\r\n",
|
| 461 |
+
" cash_inflows = revenue + other_income + interest_income\r\n",
|
| 462 |
+
" cash_outflows = cost_of_goods_sold + operating_expenses + interest_expense + income_tax\r\n",
|
| 463 |
+
"\r\n",
|
| 464 |
+
" cash_inflows_array.append(cash_inflows)\r\n",
|
| 465 |
+
" cash_outflows_array.append(cash_outflows)\r\n",
|
| 466 |
+
"#this is all \"+\" because expenses are already reported as negative values in the csv dataframe\r\n",
|
| 467 |
+
" gross_profit = revenue + cost_of_goods_sold\r\n",
|
| 468 |
+
" operating_income = gross_profit + operating_expenses\r\n",
|
| 469 |
+
" income_before_tax = operating_income + other_income + net_interest_expense_income\r\n",
|
| 470 |
+
" hh_net_income = income_before_tax + income_tax\r\n",
|
| 471 |
+
"\r\n",
|
| 472 |
+
" net_income_array.append(hh_net_income)\r\n",
|
| 473 |
+
"\r\n",
|
| 474 |
+
"# Print net income array\r\n",
|
| 475 |
+
"print(\"Net Income for Each Year: \")\r\n",
|
| 476 |
+
"print(np.array(net_income_array))\r\n",
|
| 477 |
+
"\r\n",
|
| 478 |
+
"# Calculate YoY growth for each year in the net income array #try to avoid the last element\r\n",
|
| 479 |
+
"yoy_growth_array = []\r\n",
|
| 480 |
+
"#for i in range(1, len(net_income_array)): #this thakes the lenght of the dataset whereas the code below considers only the manual imput of the years we want to analyze\r\n",
|
| 481 |
+
"for i in range(1, num_years): #here the rage could simply be num_years, so there's no need to change the data set or remove a column from the csv file, because you can select the num of years like done above.\r\n",
|
| 482 |
+
" yoy_growth = (net_income_array[i] / net_income_array[i-1]) - 1\r\n",
|
| 483 |
+
" yoy_growth_array.append(yoy_growth)\r\n",
|
| 484 |
+
"\r\n",
|
| 485 |
+
"# Define array of weights\r\n",
|
| 486 |
+
"#weights = [0.28, 0.29, 0.18, 0.29, 0.06]\r\n",
|
| 487 |
+
"weights = [0.30, 0.30, 0.20, 0.20]\r\n",
|
| 488 |
+
"\r\n",
|
| 489 |
+
"# Calculate weighted average YoY growth\r\n",
|
| 490 |
+
"net_income_weighted_average_yoy_growth = sum([a*b for a,b in zip(yoy_growth_array, weights)])\r\n",
|
| 491 |
+
"yoy_projected_net_income = []\r\n",
|
| 492 |
+
"for i in range(1, 6):\r\n",
|
| 493 |
+
" pp_net_income = hh_net_income * (1 + net_income_weighted_average_yoy_growth)\r\n",
|
| 494 |
+
" yoy_projected_net_income.append(pp_net_income)\r\n",
|
| 495 |
+
" last_net_income = pp_net_income\r\n",
|
| 496 |
+
"\r\n",
|
| 497 |
+
"# Print results\r\n",
|
| 498 |
+
"print(\"Net Income for Each Year: \")\r\n",
|
| 499 |
+
"print(np.array(net_income_array))\r\n",
|
| 500 |
+
"print(\"Net Income YoY Growth for Each Year: \")\r\n",
|
| 501 |
+
"print(np.array(yoy_growth_array))\r\n",
|
| 502 |
+
"#print(f\"YoY Average Growth: {net_income_yoy_average_growth}\")\r\n",
|
| 503 |
+
"print(\"Net Income Weighted Average YoY Growth: \", net_income_weighted_average_yoy_growth)\r\n",
|
| 504 |
+
"print(\"Projected Net Income for Next 5 Years: \")\r\n",
|
| 505 |
+
"print(np.array(yoy_projected_net_income))\r\n",
|
| 506 |
+
"\r\n",
|
| 507 |
+
"#------------------------------------------------------------------------------------------------------------------------------\r\n",
|
| 508 |
+
"\r\n",
|
| 509 |
+
"#Calculations\r\n",
|
| 510 |
+
"# Recalculate net income based on projected revenue\r\n",
|
| 511 |
+
"projected_revenue = projected_revenue[0]\r\n",
|
| 512 |
+
"projected_cost_of_goods_sold = projected_cost_of_revenue[0]\r\n",
|
| 513 |
+
"#cost_of_goods_sold = income_statement['Cost of Revenue'].iloc[-1]\r\n",
|
| 514 |
+
"projected_gross_profit = projected_revenue - projected_cost_of_goods_sold\r\n",
|
| 515 |
+
"\r\n",
|
| 516 |
+
"#operating_expenses = income_statement['Operating Income/Expenses'].iloc[-1]\r\n",
|
| 517 |
+
"projected_operating_expenses = projected_operating_expenses[0]\r\n",
|
| 518 |
+
"projected_operating_income = projected_gross_profit - projected_operating_expenses\r\n",
|
| 519 |
+
"\r\n",
|
| 520 |
+
"#other_income = income_statement['Other Income/Expense, Operating'].iloc[-1]\r\n",
|
| 521 |
+
"projected_other_income = projected_other_income[0]\r\n",
|
| 522 |
+
"#interest_expense = income_statement['Net Interest Income/Expense'].iloc[-1]\r\n",
|
| 523 |
+
"projected_interest_expense = projected_interest_expense[0]\r\n",
|
| 524 |
+
"projected_income_before_tax = projected_operating_income + projected_other_income - projected_interest_expense\r\n",
|
| 525 |
+
"\r\n",
|
| 526 |
+
"#income_tax = income_statement['Provision for Income Tax'].iloc[-1]\r\n",
|
| 527 |
+
"projected_income_tax = projected_income_tax[0]\r\n",
|
| 528 |
+
"projected_net_income = projected_income_before_tax - projected_income_tax\r\n",
|
| 529 |
+
"\r\n",
|
| 530 |
+
"print(f\"Net Income based on projected revenue is: ${net_income:.2f}\")\r\n",
|
| 531 |
+
"\r\n",
|
| 532 |
+
"# Recalculate free cash flow based on projected revenue and net income\r\n",
|
| 533 |
+
"#capital_expenditures = cash_flow_statement['Purchase/Sale and Disposal of Property, Plant and Equipment, Net'].iloc[-1]\r\n",
|
| 534 |
+
"projected_capital_expenditures = projected_capex[0]\r\n",
|
| 535 |
+
"\r\n",
|
| 536 |
+
"#current_assets = balance_sheet['Total Current Assets'].iloc[-1]\r\n",
|
| 537 |
+
"projected_current_assets = projected_current_assets[0]\r\n",
|
| 538 |
+
"#projected_current_assets_prev = projected_current_assets[-1] #is it [-1] or [+1]?\r\n",
|
| 539 |
+
"\r\n",
|
| 540 |
+
"#current_liabilities = balance_sheet['Total Current Liabilities'].iloc[-1]\r\n",
|
| 541 |
+
"projected_current_liabilities = projected_current_liabilities[0]\r\n",
|
| 542 |
+
"#projected_current_liabilities_prev = projected_current_liabilities[-1] #is it [-1] or [+1]?\r\n",
|
| 543 |
+
"\r\n",
|
| 544 |
+
"projected_working_capital = projected_current_assets - projected_current_liabilities #This is projected_working_capital\r\n",
|
| 545 |
+
"\r\n",
|
| 546 |
+
"current_assets_prev = balance_sheet['Total Current Assets'].iloc[-2]\r\n",
|
| 547 |
+
"\r\n",
|
| 548 |
+
"current_liabilities_prev = balance_sheet['Total Current Liabilities'].iloc[-2]\r\n",
|
| 549 |
+
"change_in_working_capital = current_assets - current_assets_prev + current_liabilities_prev - current_liabilities\r\n",
|
| 550 |
+
"#projected_change_in_working_capital = projected_current_assets - projected_current_assets_prev + projected_current_liabilities - projected_current_liabilities_prev\r\n",
|
| 551 |
+
"\r\n",
|
| 552 |
+
"# Projected change in working capital\r\n",
|
| 553 |
+
"projected_working_capital = projected_current_assets - projected_current_liabilities\r\n",
|
| 554 |
+
"projected_change_in_working_capital = projected_working_capital - working_capital_history[-1] #verify it is correct\r\n",
|
| 555 |
+
"print(f\"The projected change in working capital in {projection_years} years is: {projected_change_in_working_capital:.2f}\")\r\n",
|
| 556 |
+
"\r\n",
|
| 557 |
+
"projected_depreciation_amortization = projected_depreciation_amortization[0]\r\n",
|
| 558 |
+
"\r\n",
|
| 559 |
+
"projected_free_cash_flow = projected_net_income + projected_depreciation_amortization - projected_capital_expenditures - projected_change_in_working_capital\r\n",
|
| 560 |
+
"\r\n",
|
| 561 |
+
"print(f\"Free Cash Flow based on projected revenue is: ${free_cash_flow:.2f}\")\r\n",
|
| 562 |
+
"\r\n",
|
| 563 |
+
"# Calculate projected change in working capital using projected values arrays\r\n",
|
| 564 |
+
"projected_change_in_working_capital = []\r\n",
|
| 565 |
+
"initial_working_capital = historical_working_capital[-1] # Use last historical value as initial value\r\n",
|
| 566 |
+
"for i in range(1, projection_years+1):\r\n",
|
| 567 |
+
" if i == 1:\r\n",
|
| 568 |
+
" projected_change = p_working_capitals[i-1] - initial_working_capital\r\n",
|
| 569 |
+
" else:\r\n",
|
| 570 |
+
" projected_change = p_working_capitals[i-1] - p_working_capitals[i-2]\r\n",
|
| 571 |
+
" projected_change_in_working_capital.append(projected_change)\r\n",
|
| 572 |
+
"print(\"Length of projected_change_in_working_capital:\", len(projected_change_in_working_capital))\r\n",
|
| 573 |
+
"\r\n",
|
| 574 |
+
"# Create a dictionary to store the variables\r\n",
|
| 575 |
+
"my_dict = {\r\n",
|
| 576 |
+
" 'yoy_projected_net_income': yoy_projected_net_income,\r\n",
|
| 577 |
+
" 'p_capexes': p_capexes,\r\n",
|
| 578 |
+
" 'p_depreciations_amortizations': p_depreciations_amortizations,\r\n",
|
| 579 |
+
" 'projected_change_in_working_capital': projected_change_in_working_capital\r\n",
|
| 580 |
+
"}\r\n",
|
| 581 |
+
"\r\n",
|
| 582 |
+
"# Loop through the dictionary and print the lengths of the lists\r\n",
|
| 583 |
+
"for key, value in my_dict.items():\r\n",
|
| 584 |
+
" print(\"Length of\", key, \":\", len(value))\r\n",
|
| 585 |
+
"\r\n",
|
| 586 |
+
"#fair value & sensitivity analysis without rendundancies\r\n",
|
| 587 |
+
"# Calculate future cash flows using projected values arrays\r\n",
|
| 588 |
+
"future_cash_flows = []\r\n",
|
| 589 |
+
"for i in range(projection_years-1):\r\n",
|
| 590 |
+
" future_cash_flow = yoy_projected_net_income[i - 1] + p_capexes[i - 1] + p_depreciations_amortizations[i - 1] - projected_change_in_working_capital[i + 1]\r\n",
|
| 591 |
+
" future_cash_flows.append(future_cash_flow)\r\n",
|
| 592 |
+
"\r\n",
|
| 593 |
+
"# Calculate the present value of future cash flows using a discount rate\r\n",
|
| 594 |
+
"discount_rate = 0.20 # Assume a discount rate of 20%\r\n",
|
| 595 |
+
"discounted_cash_flows = [future_cash_flow / (1 + discount_rate)**(i+1) for i, future_cash_flow in enumerate(future_cash_flows)]\r\n",
|
| 596 |
+
"\r\n",
|
| 597 |
+
"# Calculate the fair value of the company\r\n",
|
| 598 |
+
"fair_value = sum(discounted_cash_flows)\r\n",
|
| 599 |
+
"\r\n",
|
| 600 |
+
"# Calculate the stock price\r\n",
|
| 601 |
+
"stock_price = fair_value / shares_outstanding\r\n",
|
| 602 |
+
"\r\n",
|
| 603 |
+
"# Print the number of years used in the calculations\r\n",
|
| 604 |
+
"#num_years = projection_years - 1\r\n",
|
| 605 |
+
"num_years = len(future_cash_flows)\r\n",
|
| 606 |
+
"print(f\"Years used in calculations: {num_years}\")\r\n",
|
| 607 |
+
"\r\n",
|
| 608 |
+
"print(f\"Fair value of the company: ${fair_value:.2f}\")\r\n",
|
| 609 |
+
"print(f\"Stock price: ${stock_price:.2f}\")\r\n",
|
| 610 |
+
"\r\n",
|
| 611 |
+
"# Sensitivity Matrix\r\n",
|
| 612 |
+
"# Define range of discount rates\r\n",
|
| 613 |
+
"discount_rates = np.arange(0.05, 0.31, 0.01)\r\n",
|
| 614 |
+
"\r\n",
|
| 615 |
+
"# Calculate the fair price of the stock for each discount rate\r\n",
|
| 616 |
+
"fair_prices = []\r\n",
|
| 617 |
+
"for rate in discount_rates:\r\n",
|
| 618 |
+
" present_value = 0\r\n",
|
| 619 |
+
" for i in range(len(future_cash_flows)):\r\n",
|
| 620 |
+
" present_value += future_cash_flows[i] / ((1 + rate) ** (i+1))\r\n",
|
| 621 |
+
" fair_price = present_value / shares_outstanding\r\n",
|
| 622 |
+
" fair_prices.append(fair_price)\r\n",
|
| 623 |
+
"\r\n",
|
| 624 |
+
"# Print fair prices for each discount rate\r\n",
|
| 625 |
+
"print(\"Fair Prices for Different Discount Rates:\")\r\n",
|
| 626 |
+
"for i in range(len(discount_rates)):\r\n",
|
| 627 |
+
" print(\"Discount Rate: {:.2%}, Fair Price: ${:,.2f}\".format(discount_rates[i], fair_prices[i]))\r\n",
|
| 628 |
+
"\r\n",
|
| 629 |
+
"#Plotting\r\n",
|
| 630 |
+
"#Historic values plots\r\n",
|
| 631 |
+
"years_back = range(1, 6)\r\n",
|
| 632 |
+
"years_back_bs = range(1, 6)\r\n",
|
| 633 |
+
"\r\n",
|
| 634 |
+
"# Reset the index of the DataFrame\r\n",
|
| 635 |
+
"#income_statement = income_statement.reset_index()\r\n",
|
| 636 |
+
"# Get the x-axis tick labels\r\n",
|
| 637 |
+
"#x_tick_labels = income_statement.iloc[0:6, 0].tolist()\r\n",
|
| 638 |
+
"x_tick_labels = income_statement.index.tolist()\r\n",
|
| 639 |
+
"\r\n",
|
| 640 |
+
"# Set seaborn style\r\n",
|
| 641 |
+
"sns.set_style('whitegrid')\r\n",
|
| 642 |
+
"fig, ax = plt.subplots(figsize=(12, 8))\r\n",
|
| 643 |
+
"ax.plot(years_back, income_statement['Total Revenue'], label='Total Revenue')\r\n",
|
| 644 |
+
"ax.plot(years_back, income_statement['Cost of Revenue'], label='Cost of revenue')\r\n",
|
| 645 |
+
"ax.plot(years_back, income_statement['Operating Income/Expenses'], label='Operating expenses')\r\n",
|
| 646 |
+
"ax.plot(years_back, income_statement['Other Income/Expense, Operating'], label='Other income')\r\n",
|
| 647 |
+
"ax.plot(years_back, income_statement['Net Interest Income/Expense'], label='Interest expense')\r\n",
|
| 648 |
+
"ax.plot(years_back, income_statement['Provision for Income Tax'], label='Income tax')\r\n",
|
| 649 |
+
"ax.plot(years_back, net_income_array, label='Net Income')\r\n",
|
| 650 |
+
"ax.plot(years_back, cash_flow_statement['Purchase/Sale and Disposal of Property, Plant and Equipment, Net'], label='Capital expenditures')\r\n",
|
| 651 |
+
"ax.plot(years_back, cash_flow_statement['Depreciation, Amortization and Depletion, Non-Cash Adjustment'], label='Depreciation & amortization')\r\n",
|
| 652 |
+
"ax.plot(years_back_bs, balance_sheet['Total Current Assets'], label='Current assets')\r\n",
|
| 653 |
+
"ax.plot(years_back_bs, balance_sheet['Total Current Liabilities'], label='Current liabilities')\r\n",
|
| 654 |
+
"ax.yaxis.set_major_formatter(mtick.StrMethodFormatter('${x:,.0f}'))\r\n",
|
| 655 |
+
"ax.yaxis.set_major_locator(plt.MaxNLocator(20))\r\n",
|
| 656 |
+
"ax.set_xlabel('Year')\r\n",
|
| 657 |
+
"ax.set_ylabel('Amount')\r\n",
|
| 658 |
+
"\r\n",
|
| 659 |
+
"# Set the x-axis tick labels\r\n",
|
| 660 |
+
"ax.set_xticks(years_back)\r\n",
|
| 661 |
+
"ax.set_xticklabels(x_tick_labels)\r\n",
|
| 662 |
+
"\r\n",
|
| 663 |
+
"# Set the position of the title\r\n",
|
| 664 |
+
"ax.set_title('Historic Values', y=1)\r\n",
|
| 665 |
+
"\r\n",
|
| 666 |
+
"# Set the position of the legend\r\n",
|
| 667 |
+
"legend = ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.15), ncol=4, fontsize='medium')\r\n",
|
| 668 |
+
"legend.set_bbox_to_anchor((0.5, 1.15))\r\n",
|
| 669 |
+
"\r\n",
|
| 670 |
+
"# Adjust the layout of the plot to make room for the legend\r\n",
|
| 671 |
+
"plt.tight_layout()\r\n",
|
| 672 |
+
"\r\n",
|
| 673 |
+
"#refresh/override projected values\r\n",
|
| 674 |
+
"projected_revenue = [revenue * (1 + revenue_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 675 |
+
"#projected_revenue = [revenue * (1 + revenue_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 676 |
+
"projected_cost_of_revenue = [cost_of_goods_sold * (1 + cost_of_revenue_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 677 |
+
"projected_operating_expenses = [operating_expenses * (1 + operating_expenses_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 678 |
+
"projected_other_income = [other_income * (1 + other_income_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 679 |
+
"projected_interest_expense = [interest_expense * (1 + interest_expense_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 680 |
+
"projected_income_tax = [income_tax * (1 + income_tax_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 681 |
+
"projected_capex = [capital_expenditures * (1 + capex_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 682 |
+
"projected_current_assets = [current_assets * (1 + current_assets_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 683 |
+
"projected_current_liabilities = [current_liabilities * (1 + current_liabilities_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 684 |
+
"projected_depreciation_amortization = [depreciation_amortization * (1 + depreciation_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 685 |
+
"projected_working_capital = [working_capital * (1 + working_capital_weighted_average_yoy_growth)**(i+1) for i in range(projection_years)]\r\n",
|
| 686 |
+
"\r\n",
|
| 687 |
+
"# Plot projected values\r\n",
|
| 688 |
+
"# Set seaborn style\r\n",
|
| 689 |
+
"sns.set_style('whitegrid')\r\n",
|
| 690 |
+
"fig, ax = plt.subplots(figsize=(12, 8))\r\n",
|
| 691 |
+
"\r\n",
|
| 692 |
+
"# Define colors for each line\r\n",
|
| 693 |
+
"colors = ['#4C72B0', '#DD8452', '#55A868', '#C44E52', '#8172B2', '#937860', '#DA8BC3',\r\n",
|
| 694 |
+
" '#8C8C8C', '#CCB974', '#64B5CD', '#BC5E00', '#003C30', '#1B2ACC', '#FF7F00',\r\n",
|
| 695 |
+
" '#2BDE73', '#D11212', '#882255', '#8B8B8B', '#2B2B2B', '#FFB5B8', '#ADFF2F']\r\n",
|
| 696 |
+
"\r\n",
|
| 697 |
+
"ax.set_prop_cycle('color', colors)\r\n",
|
| 698 |
+
"\r\n",
|
| 699 |
+
"# Find the last non-TTM year\r\n",
|
| 700 |
+
"last_year = int(income_statement.index[-2])\r\n",
|
| 701 |
+
"#x_tick_labels_projected = list(range(last_year + 1, last_year + projection_years + 1))\r\n",
|
| 702 |
+
"x_tick_labels_projected = list(range(last_year + 2, last_year + 2 + projection_years))\r\n",
|
| 703 |
+
"\r\n",
|
| 704 |
+
"ax.plot(range(1, projection_years + 1), p_revenues, label='Projected Revenue')\r\n",
|
| 705 |
+
"ax.plot(range(1, projection_years + 1), p_cost_of_goods_solds, label='Projected Cost of Goods Sold')\r\n",
|
| 706 |
+
"ax.plot(range(1, projection_years + 1), p_gross_profits, label='Projected Gross Profit')\r\n",
|
| 707 |
+
"ax.plot(range(1, projection_years + 1), p_operating_expenseses, label='Projected Operating Expenses')\r\n",
|
| 708 |
+
"ax.plot(range(1, projection_years + 1), p_operating_incomes, label='Projected Operating Income')\r\n",
|
| 709 |
+
"ax.plot(range(1, projection_years + 1), p_other_incomes, label='Projected Other Income')\r\n",
|
| 710 |
+
"ax.plot(range(1, projection_years + 1), p_interest_expenses, label='Projected Interest Expense')\r\n",
|
| 711 |
+
"ax.plot(range(1, projection_years + 1), p_income_before_taxes, label='Projected Income Before Tax')\r\n",
|
| 712 |
+
"ax.plot(range(1, projection_years + 1), p_income_taxes, label='Projected Income Tax')\r\n",
|
| 713 |
+
"#ax.plot(range(1, projection_years + 1), p_net_incomes, label='Projected Net Income')\r\n",
|
| 714 |
+
"ax.plot(range(1, projection_years + 1), yoy_projected_net_income, label='Projected Net Income')\r\n",
|
| 715 |
+
"ax.plot(range(1, projection_years + 1), p_current_assetses, label='Projected Current Assets')\r\n",
|
| 716 |
+
"ax.plot(range(1, projection_years + 1), p_current_liabilitiess, label='Projected Current Liabilities')\r\n",
|
| 717 |
+
"ax.plot(range(1, projection_years + 1), p_working_capitals, label='Projected Working Capital')\r\n",
|
| 718 |
+
"ax.plot(range(1, projection_years + 1), p_capexes, label='Projected Capex')\r\n",
|
| 719 |
+
"ax.plot(range(1, projection_years + 1), p_depreciations_amortizations, label='Projected Depreciation & Amortization')\r\n",
|
| 720 |
+
"ax.plot(range(1, projection_years), future_cash_flows, label='Future Cash Flows')\r\n",
|
| 721 |
+
"ax.plot(range(1, projection_years), discounted_cash_flows, label='Discounted Cash Flows')\r\n",
|
| 722 |
+
"#ax.plot(range(1, projection_years + 1), [fair_value] * 5, label='Fair Value')\r\n",
|
| 723 |
+
"ax.yaxis.set_major_formatter(mtick.StrMethodFormatter('${x:,.0f}'))\r\n",
|
| 724 |
+
"ax.yaxis.set_major_locator(plt.MaxNLocator(20))\r\n",
|
| 725 |
+
"ax.set_xlabel('Year')\r\n",
|
| 726 |
+
"ax.set_ylabel('Amount')\r\n",
|
| 727 |
+
"\r\n",
|
| 728 |
+
"# Set the position of the title\r\n",
|
| 729 |
+
"ax.set_title('Projected Values', y=1)\r\n",
|
| 730 |
+
"\r\n",
|
| 731 |
+
"# Set the position of the legend\r\n",
|
| 732 |
+
"legend = ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.15), ncol=4, fontsize='medium')\r\n",
|
| 733 |
+
"legend.set_bbox_to_anchor((0.5, 1.15))\r\n",
|
| 734 |
+
"\r\n",
|
| 735 |
+
"# Set the x-axis tick labels\r\n",
|
| 736 |
+
"ax.set_xticks(range(1, projection_years+1))\r\n",
|
| 737 |
+
"ax.set_xticklabels(x_tick_labels_projected)\r\n",
|
| 738 |
+
"\r\n",
|
| 739 |
+
"# Adjust the layout of the plot to make room for the legend\r\n",
|
| 740 |
+
"plt.tight_layout()\r\n",
|
| 741 |
+
"\r\n",
|
| 742 |
+
"\r\n",
|
| 743 |
+
"# Historic growth plot\r\n",
|
| 744 |
+
"historic_year_plot = range(1, 6)\r\n",
|
| 745 |
+
"projected_year_plot = range(1, 6)\r\n",
|
| 746 |
+
"fig, ax = plt.subplots(figsize=(12, 8))\r\n",
|
| 747 |
+
"ax.plot(historic_year_plot, revenue_history, label='H_Revenue')\r\n",
|
| 748 |
+
"ax.plot(historic_year_plot, cost_of_revenue_history, label='H_Cost of revenue')\r\n",
|
| 749 |
+
"ax.plot(historic_year_plot, operating_expenses_history, label='H_Operating expenses')\r\n",
|
| 750 |
+
"ax.plot(historic_year_plot, other_income_history, label='H_Other income')\r\n",
|
| 751 |
+
"ax.plot(historic_year_plot, interest_expense_history, label='H_Interest expense')\r\n",
|
| 752 |
+
"ax.plot(historic_year_plot, income_tax_history, label='H_Income tax')\r\n",
|
| 753 |
+
"#ax.plot(historic_year_plot, net_income_array, label='H_Net Income')\r\n",
|
| 754 |
+
"ax.plot(historic_year_plot, net_income_array, label='H_Net Income')\r\n",
|
| 755 |
+
"ax.plot(historic_year_plot, capex_history, label='H_Capital expenditures')\r\n",
|
| 756 |
+
"ax.plot(historic_year_plot, depreciation_history, label='H_Depreciation & amortization')\r\n",
|
| 757 |
+
"ax.plot(historic_year_plot, current_assets_history, label='H_Current assets')\r\n",
|
| 758 |
+
"ax.plot(historic_year_plot, current_liabilities_history, label='H_Current liabilities')\r\n",
|
| 759 |
+
"ax.yaxis.set_major_formatter(mtick.PercentFormatter(xmax=1000000000000, decimals=2))\r\n",
|
| 760 |
+
"ax.yaxis.set_major_locator(plt.MaxNLocator(20))\r\n",
|
| 761 |
+
"ax.set_xlabel('Year')\r\n",
|
| 762 |
+
"ax.set_ylabel('Amount')\r\n",
|
| 763 |
+
"# Set the position of the title\r\n",
|
| 764 |
+
"ax.set_title('Historic Growth', y=1)\r\n",
|
| 765 |
+
"\r\n",
|
| 766 |
+
"# Set the position of the legend\r\n",
|
| 767 |
+
"legend = ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.15), ncol=4, fontsize='medium')\r\n",
|
| 768 |
+
"legend.set_bbox_to_anchor((0.5, 1.15))\r\n",
|
| 769 |
+
"\r\n",
|
| 770 |
+
"# Set the x-axis tick labels\r\n",
|
| 771 |
+
"ax.set_xticks(years_back)\r\n",
|
| 772 |
+
"ax.set_xticklabels(x_tick_labels)\r\n",
|
| 773 |
+
"\r\n",
|
| 774 |
+
"# Adjust the layout of the plot to make room for the legend\r\n",
|
| 775 |
+
"plt.tight_layout()\r\n",
|
| 776 |
+
"\r\n",
|
| 777 |
+
"# Average growth plot\r\n",
|
| 778 |
+
"fig, ax = plt.subplots(figsize=(12, 8))\r\n",
|
| 779 |
+
"#ax.plot(historic_year_plot, [revenue_average_yoy_growth] * len(historic_year_plot), label='A_Revenue')\r\n",
|
| 780 |
+
"ax.plot(historic_year_plot, [revenue_weighted_average_yoy_growth] * len(historic_year_plot), label='A_Revenue')\r\n",
|
| 781 |
+
"#ax.plot(historic_year_plot, revenue_average_yoy_growth, label='Revenue')\r\n",
|
| 782 |
+
"ax.plot(historic_year_plot, [cost_of_revenue_weighted_average_yoy_growth] * len(historic_year_plot), label='A_Cost of revenue')\r\n",
|
| 783 |
+
"#ax.plot(historic_year_plot, cost_of_revenue_weighted_average_yoy_growth, label='Cost of revenue')\r\n",
|
| 784 |
+
"ax.plot(historic_year_plot, [operating_expenses_weighted_average_yoy_growth] * len(historic_year_plot), label='A_Operating expenses')\r\n",
|
| 785 |
+
"#ax.plot(historic_year_plot, operating_expenses_weighted_average_yoy_growth, label='Operating expenses')\r\n",
|
| 786 |
+
"ax.plot(historic_year_plot, [other_income_weighted_average_yoy_growth] * len(historic_year_plot), label='A_Other income')\r\n",
|
| 787 |
+
"#ax.plot(historic_year_plot, other_income_weighted_average_yoy_growth, label='Other income')\r\n",
|
| 788 |
+
"ax.plot(historic_year_plot, [interest_expense_weighted_average_yoy_growth] * len(historic_year_plot), label='A_Interest expense')\r\n",
|
| 789 |
+
"#ax.plot(historic_year_plot, interest_expense_weighted_average_yoy_growth, label='Interest expense')\r\n",
|
| 790 |
+
"ax.plot(historic_year_plot, [income_tax_average_yoy_growth] * len(historic_year_plot), label='A_Income tax')\r\n",
|
| 791 |
+
"#ax.plot(historic_year_plot, income_tax_average_yoy_growth, label='Income tax')\r\n",
|
| 792 |
+
"#ax.plot(historic_year_plot, [net_income_yoy_average_growth] * len(historic_year_plot), label='A_Net Income')\r\n",
|
| 793 |
+
"ax.plot(historic_year_plot, [net_income_weighted_average_yoy_growth] * len(historic_year_plot), label='A_Net Income')\r\n",
|
| 794 |
+
"ax.plot(historic_year_plot, [capex_weighted_average_yoy_growth] * len(historic_year_plot), label='A_Capital expenditures')\r\n",
|
| 795 |
+
"#ax.plot(historic_year_plot, capex_weighted_average_yoy_growth, label='Capital expenditures')\r\n",
|
| 796 |
+
"ax.plot(historic_year_plot, [depreciation_weighted_average_yoy_growth] * len(historic_year_plot), label='A_Depreciation & amortization')\r\n",
|
| 797 |
+
"#ax.plot(historic_year_plot, depreciation_weighted_average_yoy_growth, label='Depreciation & amortization')\r\n",
|
| 798 |
+
"ax.plot(historic_year_plot, [current_assets_weighted_average_yoy_growth] * len(historic_year_plot), label='A_Current assets')\r\n",
|
| 799 |
+
"#ax.plot(historic_year_plot, current_assets_weighted_average_yoy_growth, label='Current assets')\r\n",
|
| 800 |
+
"ax.plot(historic_year_plot, [current_liabilities_weighted_average_yoy_growth] * len(historic_year_plot), label='A_Current liabilities')\r\n",
|
| 801 |
+
"#ax.plot(historic_year_plot, current_liabilities_weighted_average_yoy_growth, label='Current liabilities')\r\n",
|
| 802 |
+
"ax.yaxis.set_major_formatter(mtick.PercentFormatter(xmax=1, decimals=2))\r\n",
|
| 803 |
+
"ax.yaxis.set_major_locator(plt.MaxNLocator(20))\r\n",
|
| 804 |
+
"ax.set_xlabel('Year')\r\n",
|
| 805 |
+
"ax.set_ylabel('Amount')\r\n",
|
| 806 |
+
"# Set the position of the title\r\n",
|
| 807 |
+
"ax.set_title('Average Growth', y=1)\r\n",
|
| 808 |
+
"\r\n",
|
| 809 |
+
"# Set the position of the legend\r\n",
|
| 810 |
+
"legend = ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.15), ncol=4, fontsize='medium')\r\n",
|
| 811 |
+
"legend.set_bbox_to_anchor((0.5, 1.15))\r\n",
|
| 812 |
+
"\r\n",
|
| 813 |
+
"# Set the x-axis tick labels\r\n",
|
| 814 |
+
"ax.set_xticks(years_back)\r\n",
|
| 815 |
+
"ax.set_xticklabels(x_tick_labels)\r\n",
|
| 816 |
+
"\r\n",
|
| 817 |
+
"# Adjust the layout of the plot to make room for the legend\r\n",
|
| 818 |
+
"plt.tight_layout()\r\n",
|
| 819 |
+
"\r\n",
|
| 820 |
+
"# Projected growth plot\r\n",
|
| 821 |
+
"fig, ax = plt.subplots(figsize=(12, 8))\r\n",
|
| 822 |
+
"ax.plot(projected_year_plot, projected_revenue, label='P_Revenue')\r\n",
|
| 823 |
+
"ax.plot(projected_year_plot, projected_cost_of_revenue, label='P_Cost of revenue')\r\n",
|
| 824 |
+
"ax.plot(projected_year_plot, projected_operating_expenses, label='P_Operating expenses')\r\n",
|
| 825 |
+
"ax.plot(projected_year_plot, projected_other_income, label='P_Other income')\r\n",
|
| 826 |
+
"ax.plot(projected_year_plot, projected_interest_expense, label='P_Interest expense')\r\n",
|
| 827 |
+
"ax.plot(projected_year_plot, projected_income_tax, label='P_Income tax')\r\n",
|
| 828 |
+
"ax.plot(projected_year_plot, yoy_projected_net_income, label='P_Net Income')\r\n",
|
| 829 |
+
"ax.plot(projected_year_plot, projected_capex, label='P_Capital expenditures')\r\n",
|
| 830 |
+
"ax.plot(projected_year_plot, projected_depreciation_amortization, label='P_Depreciation & amortization')\r\n",
|
| 831 |
+
"ax.plot(projected_year_plot, projected_current_assets, label='P_Current assets')\r\n",
|
| 832 |
+
"ax.plot(projected_year_plot, projected_current_liabilities, label='P_Current liabilities')\r\n",
|
| 833 |
+
"ax.yaxis.set_major_formatter(mtick.PercentFormatter(xmax=1000000000000, decimals=2))\r\n",
|
| 834 |
+
"ax.yaxis.set_major_locator(plt.MaxNLocator(20))\r\n",
|
| 835 |
+
"ax.set_xlabel('Year')\r\n",
|
| 836 |
+
"ax.set_ylabel('Amount')\r\n",
|
| 837 |
+
"# Set the position of the title\r\n",
|
| 838 |
+
"ax.set_title('Projected Growth', y=1)\r\n",
|
| 839 |
+
"\r\n",
|
| 840 |
+
"# Set the position of the legend\r\n",
|
| 841 |
+
"legend = ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.15), ncol=4, fontsize='medium')\r\n",
|
| 842 |
+
"legend.set_bbox_to_anchor((0.5, 1.15))\r\n",
|
| 843 |
+
"\r\n",
|
| 844 |
+
"# Set the x-axis tick labels\r\n",
|
| 845 |
+
"ax.set_xticks(range(1, projection_years+1))\r\n",
|
| 846 |
+
"ax.set_xticklabels(x_tick_labels_projected)\r\n",
|
| 847 |
+
"\r\n",
|
| 848 |
+
"# Adjust the layout of the plot to make room for the legend\r\n",
|
| 849 |
+
"plt.tight_layout()\r\n",
|
| 850 |
+
"\r\n",
|
| 851 |
+
"plt.show()\r\n",
|
| 852 |
+
"#------------------------------------------------------------------------------------------------------------------------------\r\n",
|
| 853 |
+
"#save the arrays in a csv file\r\n",
|
| 854 |
+
"# create a dataframe with the arrays as columns\r\n",
|
| 855 |
+
"\r\n",
|
| 856 |
+
"projections_from_statements = pd.DataFrame({\r\n",
|
| 857 |
+
" 'p_revenues': p_revenues,\r\n",
|
| 858 |
+
" 'p_cost_of_goods_solds': p_cost_of_goods_solds,\r\n",
|
| 859 |
+
" 'p_gross_profits': p_gross_profits,\r\n",
|
| 860 |
+
" 'p_operating_expenseses': p_operating_expenseses,\r\n",
|
| 861 |
+
" 'p_operating_incomes': p_operating_incomes,\r\n",
|
| 862 |
+
" 'p_other_incomes': p_other_incomes,\r\n",
|
| 863 |
+
" 'p_interest_expenses': p_interest_expenses,\r\n",
|
| 864 |
+
" 'p_income_before_taxes': p_income_before_taxes,\r\n",
|
| 865 |
+
" 'p_income_taxes': p_income_taxes,\r\n",
|
| 866 |
+
" 'p_current_assetses': p_current_assetses,\r\n",
|
| 867 |
+
" 'p_current_liabilitiess': p_current_liabilitiess,\r\n",
|
| 868 |
+
" 'p_working_capitals': p_working_capitals,\r\n",
|
| 869 |
+
" 'p_capexes': p_capexes,\r\n",
|
| 870 |
+
" 'p_depreciations_amortizations': p_depreciations_amortizations\r\n",
|
| 871 |
+
"})\r\n",
|
| 872 |
+
"\r\n",
|
| 873 |
+
"income_statement_projections = pd.DataFrame({\r\n",
|
| 874 |
+
" 'p_revenues': p_revenues,\r\n",
|
| 875 |
+
" 'p_cost_of_goods_solds': p_cost_of_goods_solds,\r\n",
|
| 876 |
+
" 'p_gross_profits': p_gross_profits,\r\n",
|
| 877 |
+
" 'p_operating_expenseses': p_operating_expenseses,\r\n",
|
| 878 |
+
" 'p_operating_incomes': p_operating_incomes,\r\n",
|
| 879 |
+
" 'p_other_incomes': p_other_incomes,\r\n",
|
| 880 |
+
" 'p_interest_expenses': p_interest_expenses,\r\n",
|
| 881 |
+
" 'p_income_before_taxes': p_income_before_taxes,\r\n",
|
| 882 |
+
" 'p_income_taxes': p_income_taxes\r\n",
|
| 883 |
+
"})\r\n",
|
| 884 |
+
"\r\n",
|
| 885 |
+
"net_income__projections = pd.DataFrame({\r\n",
|
| 886 |
+
" 'projected_net_income': net_income_array\r\n",
|
| 887 |
+
"})\r\n",
|
| 888 |
+
"\r\n",
|
| 889 |
+
"balance_sheet_projections = pd.DataFrame({\r\n",
|
| 890 |
+
" 'p_current_assetses': p_current_assetses,\r\n",
|
| 891 |
+
" 'p_current_liabilitiess': p_current_liabilitiess,\r\n",
|
| 892 |
+
" 'p_working_capitals': p_working_capitals\r\n",
|
| 893 |
+
"})\r\n",
|
| 894 |
+
"\r\n",
|
| 895 |
+
"cash_flow_statement_projections = pd.DataFrame({\r\n",
|
| 896 |
+
" 'p_capexes': p_capexes,\r\n",
|
| 897 |
+
" 'p_depreciations_amortizations': p_depreciations_amortizations\r\n",
|
| 898 |
+
"})\r\n",
|
| 899 |
+
"\r\n",
|
| 900 |
+
"cash_flow_projections = pd.DataFrame({\r\n",
|
| 901 |
+
" 'future_cash_flows': future_cash_flows,\r\n",
|
| 902 |
+
" 'discounted_cash_flows': discounted_cash_flows\r\n",
|
| 903 |
+
"})\r\n",
|
| 904 |
+
"\r\n",
|
| 905 |
+
"# save the dataframes to a CSV file\r\n",
|
| 906 |
+
"projections_from_statements.to_csv('projections_from_statements.csv', index=False)\r\n",
|
| 907 |
+
"income_statement_projections.to_csv('income_statement_projections.csv', index=False)\r\n",
|
| 908 |
+
"net_income__projections.to_csv('net_income__projections.csv', index=False)\r\n",
|
| 909 |
+
"balance_sheet_projections.to_csv('balance_sheet_projections.csv', index=False)\r\n",
|
| 910 |
+
"cash_flow_statement_projections.to_csv('cash_flow_statement_projections.csv', index=False)\r\n",
|
| 911 |
+
"cash_flow_projections.to_csv('cash_flow_projections.csv', index=False)"
|
| 912 |
+
]
|
| 913 |
+
}
|
| 914 |
+
],
|
| 915 |
+
"metadata": {
|
| 916 |
+
"kernelspec": {
|
| 917 |
+
"display_name": "Python 3",
|
| 918 |
+
"language": "python",
|
| 919 |
+
"name": "python3"
|
| 920 |
+
},
|
| 921 |
+
"language_info": {
|
| 922 |
+
"codemirror_mode": {
|
| 923 |
+
"name": "ipython",
|
| 924 |
+
"version": 3
|
| 925 |
+
},
|
| 926 |
+
"file_extension": ".py",
|
| 927 |
+
"mimetype": "text/x-python",
|
| 928 |
+
"name": "python",
|
| 929 |
+
"nbconvert_exporter": "python",
|
| 930 |
+
"pygments_lexer": "ipython3",
|
| 931 |
+
"version": "3.10.10"
|
| 932 |
+
},
|
| 933 |
+
"papermill": {
|
| 934 |
+
"default_parameters": {},
|
| 935 |
+
"duration": 16.786425,
|
| 936 |
+
"end_time": "2023-07-09T16:09:49.294552",
|
| 937 |
+
"environment_variables": {},
|
| 938 |
+
"exception": true,
|
| 939 |
+
"input_path": "__notebook__.ipynb",
|
| 940 |
+
"output_path": "__notebook__.ipynb",
|
| 941 |
+
"parameters": {},
|
| 942 |
+
"start_time": "2023-07-09T16:09:32.508127",
|
| 943 |
+
"version": "2.4.0"
|
| 944 |
+
}
|
| 945 |
+
},
|
| 946 |
+
"nbformat": 4,
|
| 947 |
+
"nbformat_minor": 5
|
| 948 |
+
}
|
financial-statement-analysis-using-python.ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
income-statement (1).xlsx
ADDED
|
Binary file (39.9 kB). View file
|
|
|
tesla test.xlsx
ADDED
|
Binary file (14.1 kB). View file
|
|
|