python能做财务分析吗

问题 (The Problem)

If you work in the Financial Planning and Analysis area, chances are you are dealing with large Excel models on a daily basis.

如果您在“财务计划和分析”区域中工作,则很有可能每天都要处理大型Excel模型。

Most probably, the Excel file has grown significantly and you are experiencing the typical problems of: unstable file, lack of performance, versioning control issues, linkage governance (when someone inserts a row or a column, and the linked files are closed), among many others.

最有可能的是,Excel文件已经显着增长,并且您遇到的典型问题包括:文件不稳定,性能不足,版本控制问题,链接管理(当有人插入行或列,并且关闭了链接文件时),其中很多其他的。

There are other types of problems of working with large spreadsheets that are not so obvious to identify:

使用大型电子表格还有其他类型的问题,这些问题不太明显,无法识别:

  • Transparency: you are the only one who understands your spreadsheet and it is hard to communicate how it really works (users need to trust you)透明度:您是唯一了解电子表格的人,很难传达其真正的工作方式(用户需要信任您)
  • Multi-Dimensional calculations: Microsoft smelled the need for that when they implemented matrix formulas but, to be honest, it is an extremely rigid and difficult way of working in Excel多维计算:在实现矩阵公式时,Microsoft闻到了对此的需求,但是老实说,这是在Excel中工作的极其僵化和困难的方式

If the problems above sound familiar to you, that means you have reached the limits of Excel and should consider moving to another platform.

如果您对上述问题熟悉,则表明您已达到Excel的极限,应考虑迁移到另一个平台。

Spreadsheets were developed as a digital replacement of accounting tasks. Excel was launched in 1985 and the basic paradigm has not changed since its invention. Think how the world changed since 1985. Don’t you think it is high time we update the way we do financial planning?

电子表格被开发为会计任务的数字替代。 Excel于1985年启动,自从发明以来,基本范例就没有改变。 想一想自1985年以来世界是如何变化的。您不认为现在该是我们更新财务规划方式的时候了吗?

The question is where to take the next step in Financial Planning. Which environment offers the ease of use of Excel also solves the problems Excel has?

问题是在财务计划中应该采取下一步措施。 哪种环境提供了Excel的易用性,还解决了Excel所存在的问题?

The short answer is Python, and I will explain to you why.

简短的答案是Python,我将向您解释原因。

平滑从Excel到Python的过渡 (Smoothing the transition from Excel to Python)

I want to make your first contact with Python as simple and pleasant as possible. If you don’t feel comfortable installing apps on your computer, you can work online here.If you are already committed to give Python a try we will start installing Python 3.7 version first (Notice it is not the last one!). You can download it from here after selecting the appropriate version for your operating system.

我想让您与Python的第一次接触尽可能简单和愉快。 如果您不满意在计算机上安装应用程序,则可以在此处在线工作。如果您已承诺尝试使用Python,我们将首先开始安装Python 3.7版本(请注意,这不是最后一个!)。 选择适合您操作系统的版本后,可以从此处下载。

Then we will install a Python application intended for Business Planning & Analysis called Pyplan, following the instructions below. Further installing alternatives (Mac/Linux/Anaconda) can be found here.

然后,我们将按照以下说明安装用于业务计划和分析的Python应用程序Pyplan。 可以在此处找到其他安装替代方法(Mac / Linux / Anaconda)。

Press Windows+R to open the “Run” box. Type cmd and then click OK. Then run these commands:

Windows + R打开“运行”框。 键入cmd ,然后单击“ 确定” 。 然后运行以下命令:

# Installpython3.7 -m venv pyplanpyplan\Scripts\activate.batpip install — upgrade pippip install pyplan-ide# Runpyplan\Scripts\activate.batpyplan

Assuming everything went right on installing, your default browser on your device will open showing the Pyplan welcome page:

假设安装一切正常,设备上的默认浏览器将打开,显示Pyplan欢迎页面:

Notice that the address bar in your browser will show http://localhost:9740/# this indicates the Pyplan app is running on your own computer so that it does not require internet connection.

请注意,浏览器中的地址栏将显示http:// localhost:9740 /#,这表明Pyplan应用程序正在您自己的计算机上运行,​​因此不需要Internet连接。

The second time you access Pyplan, you just need to open the console (Press Windows+R to open the “Run” box. Then Type cmd)

第二次访问Pyplan时,只需打开控制台(按Windows + R打开“运行”框,然后键入cmd)。

# Runpyplan\Scripts\activate.batpyplan

改变一些范式 (Changing some paradigms)

Years of working in 2D spreadsheets have flattened our minds for thinking about calculations. Real world problems are multidimensional rather than two dimensional. For example, we deal with units sold by regions, products, sales channels, and time, and those are four dimensions.

多年来在2D电子表格中的工作使我们对计算的思考变得平淡无奇。 现实世界中的问题是多维的,而不是二维的。 例如,我们处理按地区产品销售渠道时间 销售的 单位 ,这是四个维度。

If you have to calculate revenues as units sold times price that will require choosing two dimensions, probably time for columns and products for rows, and replicate the table as many times as the product of regions times sales channels.

如果必须将销售收入乘以价格来计算收入,则需要选择两个维度(列时间和行产品时间),并将表复制的次数是地区乘以销售渠道的次数。

Wouldn’t be nice just to write Revenue = Units_sold * Price and let the calculation engine automatically solve the alignment of dimensions?

仅仅写下 Revenue = Units_sold * Price 并让计算引擎自动解决尺寸对齐会不好吗?

Well, in Python the answer is a big yes and that is not the only good news!

好吧,在Python中,答案是肯定的,但这不是唯一的好消息!

But, before we get into the Python multidimensional world we need to reset our mind, and like Neo in the Matrix movie, start discovering dimensions and matrices in our planning model.

但是,在进入Python多维世界之前,我们需要重新设置主意,就像Matrix电影中的Neo一样,开始在我们的规划模型中发现尺寸和矩阵。

Neo discovering “The Matrix”
Neo发现“黑客帝国”

What are dimensions (aka indexes)? In short they are the list of rows and columns labels that define what a cell number represents. The matrices are the tables containing numbers grouped together as the figure below illustrates.

什么是尺寸(又称索引)? 简而言之,它们是定义单元格编号表示的行和列标签的列表。 矩阵是包含数字的表,如下图所示。

迈出第一步 (Making the first steps)

Now we are ready. Click on “Create a new model” to start working on our model. Provide a name and click Ok. You will reach the workspace to start modeling as shown in the image below.

现在我们准备好了。 单击“创建新模型”以开始使用我们的模型。 提供一个名称,然后单击确定。 您将到达工作区以开始建模,如下图所示。

The first thing we will do is to read a csv file with historical sales data.

我们要做的第一件事是读取包含历史销售数据的csv文件。

For that we will click on the wizard section located in the right toolbar and drag and drop a Read CSV node. It will prompt a file location, we will indicate the following url:

为此,我们将单击右侧工具栏中的向导部分,然后拖放“读取CSV”节点。 它将提示文件位置,我们将指示以下URL:

http://img.pyplan.org/1000_Sales_Records.csv

http://img.pyplan.org/1000_Sales_Records.csv

It will first show you a preview of the file. Click next and Pyplan will show you a suggestion of indexes found in the csv file. We don’t want any indexes yet so click “Unselect All” and press the Submit button.

它将首先向您显示文件的预览。 单击下一步,Pyplan将为您显示在csv文件中找到的索引建议。 我们还不需要任何索引,因此请单击“取消全选”,然后按“提交”按钮。

Now we have created our first node, named “node1” by default. We will rename it as “Sales Database”. To do that click on the node to select it, then click on the Properties tab and type Sales Database on the Title field. After you hit enter, you will notice the Id of the node changes to sales_database. This is the Id we will use to call this node on the following calculation steps.

现在,我们创建了第一个节点,默认情况下名为“ node1”。 我们将其重命名为“销售数据库”。 为此,请单击节点以将其选中,然后单击“ Properties选项卡,然后在“ Title字段上键入Sales Database。 按下Enter键后,您会注意到节点的ID更改为sales_database。 这是我们将在以下计算步骤中用来调用此节点的ID。

Now let’s go back to the Code tab and click on the run button.

现在,让我们回到“ Code选项卡,然后单击“运行”按钮。

Excel only has one type of object, the cell, that can take any type of values: numbers, text, dates, etc. In Python you can have different types of objects like a single value, a list, a database, a matrix or any other different type that must be considered when operating.

Excel仅具有一种对象类型,即单元格,可以采用任何类型的值:数字,文本,日期等。在Python中,您可以具有不同类型的对象,例如单个值,列表,数据库,矩阵或操作时必须考虑的任何其他不同类型。

After evaluating the node Pyplan realizes which type of object the node is, in this case, it is a Pandas dataframe, and based on that displays a series of tools to assist working with that type of data object.

在评估节点之后,Pyplan会意识到该节点是哪种类型的对象,在这种情况下,它是一个Pandas数据框,并在此基础上显示了一系列工具来帮助处理该类型的数据对象。

Pandas is one of the most used Python libraries, it is an in-memory database object type, with an extremely complete and powerful list of functions included. You can read more about Pandas here.

Pandas是最常用的Python库之一,它是内存数据库对象类型,其中包含极其完整和强大的功能列表。 您可以在此处阅读有关熊猫的更多信息。

We will use the “Create DataArray” wizard to generate a multidimensional node with the units sold. Replicate in your wizard the selection shown below:

我们将使用“创建数据数组”向导来生成包含所售单位的多维节点。 在向导中复制如下所示的选择:

After clicking Ok you will see in the diagram the created indexes named Region, Item Type, Sales Channel, and a node named “Sum of Units Sold”.

单击“确定”后,您将在图中看到名为Region,物料类型,销售渠道的创建索引以及名为“已售单位总数”的节点。

Just double click on the node to evaluate it. A pivot table will be displayed. You can slice and dice the table and create a visualization of it as indicated in the figure below, clicking on the dots and selecting Table & Graph > to right.

只需双击该节点即可对其进行评估。 将显示数据透视表。 您可以对表进行切片和切块,并如下图所示创建其可视化效果,单击点,然后选择右侧的“表和图”>。

Now we will create a second node as the Mean of executed prices opened by Region, Item Type and Sales Channel. To do that we have to select again the Sales Database node and at the Code tab click again on the Create DataArray tool. Now the wizard will open preselecting the existing indexes. Check the Mean of Unit Price and click Ok.

现在,我们将创建第二个节点,作为按RegionItem TypeSales Channel打开的执行价格均值。 为此,我们必须再次选择“ Sales Database节点,然后在“ Code选项卡上再次单击“ Create DataArray工具。 现在,向导将打开并预选择现有索引。 检查平ASP格,然后单击确定。

Check Mean of Unit Price to generate the matrix

检查单价均值以生成矩阵

Now we have the Sum of Units Sold and Mean of Unit Price nodes created we are ready to calculate Revenue as the product of the two previous nodes. Drag a new variable node. Name it Revenue then go to the Code </> tab. Reference the “Sum of Units Sold” by pressing and holding the Alt key (option key in Mac) and clicking on it. This puts its ID (name of the node) into the formula ( you could have written it if you knew it already). Type the multiply * then hold Alt and select the “Mean of Unit Price” node to complete the formula.

现在我们已经创建了Sum of Units SoldSum of Units SoldMean of Unit Price节点,我们准备将“收入”计算为前两个节点的乘积。 拖动一个新的变量节点。 将其命名为Revenue,然后转到Code </>选项卡。 按住Alt键(在Mac中为Option键)并单击以引用“已售出的商品总数”。 这会将其ID(节点名称)放入公式中(如果您已经知道的话,可以编写它)。 输入乘号*,然后按住Alt并选择“单价均值”节点以完成公式。

Multidimensional calculation in action
进行多维计算

Great! we have realized our dream of being able to tell a modeling platform to compute the Revenue in plain english as Units Sold times Prices. You can run the node clicking on the yellow run button and inspect its console output. Much more interesting is to double click to evaluate it as a table and create a graph visualization as shown in the image above.

大! 我们已经实现了我们的梦想,那就是能够告诉建模平台以简单的英语形式将销售收入乘以价格来计算收入。 您可以单击黄色的运行按钮来运行节点,并检查其控制台输出。 更加有趣的是,双击将其评估为表格,然后创建图形可视化效果,如上图所示。

As a homework check what happens if you create a Price node just indexed by Item Type and create another Revenue node defined as the Units Sold time the new Price. Can you guess how the calculation was made?

作为一项家庭作业,请检查如果创建一个仅按“ Item Type索引的“价格”节点,并创建另一个定义为“新价格的售出单位”的“收入”节点,会发生什么情况。 您能猜出计算是如何进行的吗?

In a coming article we will complete the model and construct a basic Profit and Loss Statement.

在接下来的文章中,我们将完成模型并构建基本的损益表。

As any change in the way we work the first steps are the most difficult. As a former Excel heavy user I can guarantee it is worth the effort.

由于我们工作方式的任何变化,第一步都是最困难的。 作为以前的Excel重度用户,我可以保证值得您付出努力。

Give it a try and let me know your feedback!

试试看,让我知道您的反馈!

翻译自: https://medium.com/swlh/can-you-do-financial-planning-and-analysis-with-python-9bad015c4d03

python能做财务分析吗


http://www.taodudu.cc/news/show-3469380.html

相关文章:

  • [数据集] CNRDS上市公司管理层讨论与分析数据(1999-2020年)
  • 采购中的高级分析方法
  • GARP翻译:信用风险评估——基于文本分析的好处
  • 《pandas数据分析》(一)——数据基础操作
  • 常用统计分析软件介绍
  • 需求分析的经验之谈
  • python 财务分析可视化方法_Python数据可视化的四种简易方法
  • xbrl 数据比较分析_思考XML,使用XBRL分析财务报告
  • 财务数据分析sql python_我是如何从会计转行到数据分析
  • python与财务审计报告翻译_财务报表分析中英文对照外文翻译文献
  • 鸢尾花、葡萄酒分类数据集
  • 李白无事街上走,提壶去买酒。遇店加一倍,见花喝一斗,五遇花和店,喝光壶中酒,试问李白壶中原有多少斗酒?(使用for循环结构编程实现)
  • 蓝桥杯2014省赛——李白打酒(Java)
  • java李白打酒蓝桥杯
  • 李白打酒c语言编程,c/c++开发分享蓝桥杯-李白喝酒
  • 李白打酒c语言,关于“李白打酒”的一道数学题
  • 葡萄酒的评价matlab代码,MATLAB·设计论文葡萄酒质量评价数学建模.docx
  • 葡萄酒的评价matlab代码,MATLAB·设计论文葡萄酒质量评价的数学建模
  • c语言李白喝酒答案,趣題C解(1)--李白喝酒問題
  • 李白喝酒 c语言编程题,python算法练习题:李白喝酒
  • Math概览
  • 悬铃水量子计算机,悬铃叶苎麻无融合生殖类型起源的遗传基础研究
  • 替换replace,translate
  • Oracle-函数
  • CentOS 安装hping3工具及安装遇到的错误及解决方法
  • Python连接Greenplum及常用gp函数和方法(持续更新)
  • 我的mysql小笔记
  • Hive 函数大全(吐血整理)
  • 带你简单了解MySQL
  • mysql语言的学习

python能做财务分析吗_您可以使用Python进行财务规划和分析吗?相关推荐

  1. python自己做个定时器_简单实现python定时器

    下面介绍以threading模块来实现定时器的方法.(课课家) 使用前先做一个简单试验: import threading def sayhello(): print "hello worl ...

  2. python主要做什么的_学了Python可以用来干什么呢?

    很多家长朋友可能会问,孩子学Python 可以用来干什么呢? 一般学Python可以往很多方面发展: 01 web应用开发 在国内,豆瓣一开始就使用Python作为web开发基础语言,知乎的整个架构也 ...

  3. python能做什么日常_我用 Python 做些什么?

    我主要工作是后端,所以这一点我就不说了.本文主要说下我用 Python 做的其它的一些事. 1 数据导出支撑 一个月可能有一两次需要导出一些数据,每次的需求都有些不同.刚开始的时候还好,用数据库的一些 ...

  4. python能做人机界面吗_人机交互程序 python实现人机对话

    自己随便写了一个人机交互的程序.不存在任何智能,只是可以识别姓名,可以记录对话内容,并保存等到下一次交互时加载. (推荐面向对象版本) # hello.py # 这是老早写的.不过今天加入了Pickl ...

  5. python学了能干什么_学了python能干什么

    学了python能做些什么 1.WEB开发 Python拥有很多免费数据函数库.免费web网页模板系统.以及与web服务器进行交互的库,可以实现web开发,搭建web框架,目前比较有名气的Python ...

  6. python怎么做软件程序_如何打包和发布Python程序

    如何打包和发布Python程序 在使用Python的过程中,我们经常需要做的一件事情就是通过pip来安装第三方的包.那么你是否也曾想过pip安装的包是怎么被打包并发布上去的呢?今天就来说一说Pytho ...

  7. python能做些什么事_一起来看看Python能干什么?使用Python能做哪些事

    原标题:Python能干什么?使用Python能做哪些事情? 先来看看Python的定义: Python是一种动态的.面向对象的脚本语言,尤其近几年Python在TIOBE上的排名直线上升,那么Pyt ...

  8. python怎么做软件程序_看 Python 超级程序员使用什么开发工具

    Python超级程序员使用的开发工具 我以个人的身份采访了几个顶尖的Python程序员,问了他们以下5个简单的问题: 当前你的主要开发任务是什么? 你在项目中使用的电脑是怎样的? 你使用什么IDE开发 ...

  9. python适合做什么生意_适合Python的5大练手项目,你练了么?

    在练手项目的选择上,还存在疑问?不知道要从哪种项目先下手? 首先有两点建议: 最好不要写太应用的程序练手,要思考什么更像是知识,老只会写写爬虫是无用的,但是完全不写也不行. 对于练手的程序,要注意简化 ...

最新文章

  1. Go 学习笔记(24)— 并发(03)[通道特点、通道声明、通道发送/接收/关闭、单向通道]
  2. oracle里面子判断,在过程中添加子进程,在子过程中判断
  3. matlab面向对象排序,matlab面向对象编程基础
  4. Codeforces Round #323 (Div. 1) B. Once Again... 暴力
  5. Python 日期和时间戳的转换
  6. 多校一道KMP+DP的题
  7. mysql java 社工库_社工库源码
  8. Android Ndef Message解析
  9. 当前最流行的Javaweb框架有哪些?
  10. 日常css小tips
  11. 全国计算机等级考试三级数据库技术(十)
  12. jquery提交表单验证示例代码
  13. vdi linux桌面,ubuntu VDI ( Ulteo Open Virtual Desktop
  14. yigo 第一阶段 异常处理 解决方案
  15. Linux进阶之路-Ubuntu版
  16. 安卓4.4.4安装哪个微信版本_安卓用户喜大普奔!安卓版微信7.0.13内测版发布,支持深色模式!...
  17. 哈尔滨工业大学计算机考研专业课,2020考研哈尔滨工业大学计算机考研考试科目...
  18. 前端如何实现一键截图功能?
  19. 2021年江苏高考成绩查询时间,2021年江苏高考成绩什么时候出来 公布时间
  20. 位图+布隆过滤器-待续

热门文章

  1. 只因女朋友一个建议,这个程序员创立仅551天公司后被10亿美元收购了
  2. [FML]学习笔记三 Rademacher Complexity
  3. 离职员工讲述易到混乱:CEO在办公室煮面条、逼员工下跪
  4. oracle添加触发器无效,Oracle触发器无效
  5. jquery插件 (jquery之家)的使用案列,(瀑布流的使用)非常简单
  6. JavaScript加密解密7种方法总结分析
  7. Net Core 3.1 中使用JWT认证
  8. 关于Unicode,UTF-8,GB编码详解
  9. CSS 实现“故障”特效
  10. Win7的任务计划怎么是后台运行的,怎么设置能让任务前台运行?