我想在python中创建一个脚本,它将在python中计算Beneish M Score

时间:2015-11-11 08:14:58

标签: python dictionary

表1 - 财务(独立)

Year                            2014              2013            2012            2011            2010
Net Sales                       8,020.35          9,754.50        8,433.48        6,447.24        4,827.47 
Cost of Goods                   5,524.76          7,416.64        6,299.72        4,494.74        3,176.16 
Net Receivables                 2,045.70          2,807.26        1,689.88        1,109.29        693.33 
Current Assets                  4,000.61          4,894.15        4,228.61        2,747.23        2,236.16 
Property, Plant and Equipment   1,848.27          2,177.22        1,948.19        1,834.23        1,552.22 
Depreciation                    199.02            219.18          203.06          194.05          180.10 
Total Assets                    13,994.40         13,215.16       12,186.17       10,201.72       8,480.00 
SGA Expense                     588.25            495.77          451.73          347.35          338.63 
Net Income                      673.95            423.05          345.39          379.69          283.40 
Cash Flow from Operations       988.18            1.17            406.65          340.06          1,069.19 
Current Liabilities             4,301.49          4,697.45        4,868.32        3,087.15        889.03 
Long-term Debt                  1,492.06          1,503.40        1,475.46        1,534.03        3,640.02 

表2 - 财务(合并)

Year                            2014        2013        2012        2011        2010
Net Sales                       26,111.94   26,003.67   21,840.29   18,187.77   15,523.34
Cost of Goods                   10,323.87   11,543.19   9,156.12    6,872.80    5,519.23
Net Receivables                 2,642.69    3,358.56    2,220.68    1,530.03    1,083.42
Current Assets                  17,581.22   17,393.72   13,317.96   10,932.59   5,528.21
Property, Plant and Equipment   17,998.98   15,444.53   12,490.63   8,847.56    6,544.69
Depreciation                    1,608.86    1,295.49    1,092.33    940.90      866.48
Total Assets                    63,034.10   57,105.27   45,157.00   39,600.52   28,988.86
SGA Expense                     1,730.27    1,625.98    1,347.43    1,231.69    1,640.42
Net Income                      1,221.80    1,183.89    1,010.15    907.97      154.56
Cash Flow from Operations       47.62       -993.70     153.47      1,263.04    4,235.99
Current Liabilities             14,515.48   15,660.07   11,881.23   9,106.74    3,206.53
Long-term Debt                  12,460.74   9,392.73    5,641.57    4,680.65    7,432.40

从上表我需要计算不同的索引:

索引1:Days Sales in Receivables Index (DSRI) = Net Receivable [CY]/ Net Sales [CY] Divided by Net Receivable [CY-1]/ Net Sales [CY-1]

所以我认为将所有表1数据存储在字典中,如下所示:

Net_Sales = {2014: 8020.35, 2013:9754.50, 2012:8433.48, 2011:6447.24, 2010:4827.47}
Cost_Goods = {2014: 5524.76, 2013:7416.64, 2012:6299.72, 2011:4494.74, 2010:3176.16}
Net_Receivables = {2014:2045.70, 2013:2807.26, 2012:1689.88, 2011:1109.29, 2010:693.33}
Current_Assets = {2014:4000.61, 2013:4894.15, 2012:4228.61, 2011:2747.23, 2010:2236.16}
Property_Plant_Equipment = {2014:1848.27, 2013:2177.22, 2012:1948.19, 2011:1834.23, 2010:1552.22}
Depreciation = {2014:199.02, 2013:219.18, 2012:203.06, 2011:194.05, 2010:180.10}
Total_Assets = {2014:13994.40, 2013:13215.16, 2012:12186.17, 2011:10201.72, 2010:8480.00}
SGA_Expense = {2014:588.25, 2013:495.77, 2012:451.73, 2011:347.35, 2010:338.63}
Net_Income = {2014:673.95, 2013:423.05, 2012:345.39, 2011:379.69, 2010:283.40}
Cash_Flow_Operations = {2014:988.18, 2013:1.17, 2012:406.65, 2011:340.06, 2010:1069.19}
Current_Liabilities = {2014:4301.49, 2013:4697.45, 2012:4868.32, 2011:3087.15, 2010:889.03}
Long_Deb = {2014:1492.06, 2013:1503.40, 2012:1475.46, 2011:1534.03, 2010:3640.02}

但是我还需要为表2制作大量字典。

我需要再次在表格中显示输出:

#Index 1 using the formula 1.
Net Receivable [CY-1]/ Sales [CY-1]
Year                            2014    2013    2012    2011
As per Standalone Financials    0.886   1.436   1.165   1.198
As per Consolidated Financials  0.784   1.270   1.209   1.205

我使用以下公式计算了第一个值:

DSRI = (Net_Receivables[2014]/Net_Sales[2014]) / (Net_Receivables[2013]/Net_Sales[2013])

我得到了唯一的价值。因此,进行上述计算将是非常繁忙和无计划的方式。因为我需要对上述数据进行大量计算。所以有人可以帮助我如何存储这些数据,如果不是在字典然后在哪里。我应该如何计划计算所有必需的值。因为我需要计算8个索引,也许将来我可以在不同的年份重复使用它。谢谢。如果您需要更多信息,请告诉我。

0 个答案:

没有答案