Financial Modeling with Python and Excel¶
Introduces myself, the course structure, financial modeling, the tools we will use, and how to set up Python.
Resources¶
About Me¶
Notes¶
I am currently a Finance Ph.D. student at UF focusing on market intervention, alternative assets, and behavioral finance
This is my third time teaching Financial Modeling and I taught Debt and Money Markets twice previously
Undergraduate and master’s degrees in Finance from Virginia Commonwealth University (VCU)
Worked as the only commercial loan portfolio analyst at a small bank (about $1B in assets, 15 branches). During my time there, saved the bank $4.5 million dollars
Represented VCU in the Chartered Financial Analyst (CFA) Equity Research Challenge, our team got in the top 12 out of ~800 university teams from around the world
I am a strong supporter of open-source software. I develop packages as part of my research and also as part of this class.
Transcript¶
- hey everyone
- nick dear burtis here teaching you
- financial modeling today i'm here to
- talk about
- me who am i and what is my background
- and story
- so i am a phd student here at uf
- uh focusing on finance of course
- more specifically my main research areas
- are
- market intervention you know what
- governments and other players are doing
- to intervene in markets
- alternative assets such as crypto
- currencies including
- bitcoin and others and behavioral
- finance things like
- investor attention and cinnamon and how
- they affect valuation
- as far as this course this is my third
- time
- teaching financial modeling and twice
- before i've also taught
- debt and money markets um
- looking to my background i have an
- undergraduate and a master's degree in
- finance
- from vcu virginia commonwealth
- university
- um and while i was in richmond
- i also you know took the time to
- get some work experience i worked for a
- small bank
- they had about 1 billion in assets about
- 15 branches
- and i worked there as the only
- commercial loan portfolio analyst
- and while i worked there i was only
- there for a year
- but i was able to save them four and a
- half
- million dollars another
- notable accomplishment of mine is
- that while i was at vcu i competed
- in the cfa chartered financial analyst
- equity research challenge that's an
- investment
- research challenge where you do an
- in-depth
- analysis and model of a particular stock
- and you ultimately
- give a recommendation buy sell or hold
- the stock
- as well as a report and a presentation
- to go along with that
- and out of around 800 teams
- around the world you know each one one
- team
- per university our university's team
- ended up getting in the top 12 out of
- these 800 global teams
- uh so that was pretty happy about how
- that went
- um and then um
- another notable thing about me is that
- i'm a strong supporter
- and developer of open source software
- so open source software is software
- that's not only
- free to use but also uh
- the source code the the code that
- creates that software
- is also open available public free to
- use
- um and so i'm a strong supporter of that
- i think it really
- helps us you know as you know a human
- collective
- ultimately um you know a society
- get closer to our goals uh by having
- these things open and free and available
- uh you can kind of stand on the
- shoulders of giants rather than having
- to
- reinvent the wheel yourself every time
- and so i develop a number of these
- packages
- right now i have around 30 of them as
- part of my research
- and also as part of this class so we'll
- talk about
- a couple of them uh during this class
- and we'll get an opportunity to
- use them and i think you'll find that
- some of the
- packages i've developed for this class
- are are very useful
- for doing financial modeling in python
- for example
- i've created the fin statement package
- which lets you easily
- load in financial statements into python
- and work with them
- and makes the modeling exercises all
- that much
- easier when you don't have to focus on
- some of that more
- boilerplate code
- so that's uh and then day to day
- i um you know i'm working on research
- working on the class
- um i'm married
- uh my wife and i love to be outdoors we
- love to go camping and hiking
- and um i love working with my hands
- i do all of the maintenance on my
- family's vehicles and i have
- for uh more than 10 years um
- so yeah that's pretty much a quick
- overview of me
- so next time we will look at an overview
- of the syllabus and the expectations
- in the course so thanks for listening
- see you next time
Syllabus¶
Notes¶
Get the textbook if you’re someone who learns well from reading, and doesn’t have a lot of Excel experience. Otherwise it probably won’t be very helpful
Mac and Windows are both fine, though I don’t have much experience on Mac so I won’t be as helpful with OS-specific issues
This class is hard. Those who don’t have good technical skills already should prepare to put a lot of work in or consider another course.
We focus on the modeling process and skills, not as much on the finance, so you need to have a good knowledge of finance first.
If you don’t have any of the required Excel skills, take a look at the resources provided on the syllabus and ask me any questions
The lab sessions are perhaps the most valuable part of the course because you can get lots of hands on feedback
I have consistently heard that these are the hardest (and most rewarding) projects in the finance program at UF. Start early and ask questions.
I would highly encourage those who don’t have Python experience to work through some of the resources in the syllabus. This will greatly enhance your learning and allow you to focus on the models rather than struggling with programming basics.
Please review the syllabus document for the grading structure
Transcript¶
- hey everyone
- nick dear burtis here teaching you
- financial modeling
- today i'm here to talk about the
- syllabus and expectations
- for the course so let's go ahead and go
- over to the syllabus
- so um the first thing to note on here
- is the textbook uh so the textbook
- here i'm recommending uh simon baninga's
- financial modeling book
- now an important thing to note about
- this book is it is excel
- only i have not yet been able to find a
- good
- python financial modeling book maybe
- i'll
- ultimately end up writing that book
- but for now this is kind of the best
- that we have
- for the course now i
- certainly this textbook is not required
- i would generally only recommend it
- if you're someone who learns well just
- from reading
- a textbook and you also don't have a ton
- of excel experience
- or you're not you know super familiar
- with the finance
- because the book is helpful for the
- excel side of things and just
- generally how to go about building the
- model
- but it's not really going to help you at
- all as far as the
- the python side beyond you know knowing
- generally
- what goes into the model um
- so certainly don't feel the need to
- purchase that unless you fall into that
- category
- um as far as your computer you know the
- main requirement for the class is is
- having a computer that can run
- microsoft excel either mac or windows is
- fine
- though you know i'm a i'm a windows and
- linux user
- so i haven't used mac very much and so i
- won't be able to help as much
- on any kind of operating specific
- operating system specific
- issues that you may have uh using a mac
- but certainly it works for all the
- course material just fine
- and many students have gone through the
- course using a mac before
- so uh you know the general idea of this
- course
- is that we are covering generally
- how to build a financial model
- not necessarily you know here's the 10
- different
- types of models let's learn all the
- steps to complete each of those models
- it's more about a general process
- and the skills required to build any
- financial model
- so my goal is to give you the these
- skills and patterns
- uh and ideas so that you go on the job
- and you know they ask you to build
- a model for a situation where
- it's not just you know your standard
- like fill in some template is no it's a
- custom model that you have to tailor to
- this situation
- you'll be ready to go and do that so
- that's the idea here is to
- give more real world kind of experience
- and skills
- uh to be able to do this all on your own
- out in the workforce
- and the two tools that we're going to
- focus on
- to uh implement these models
- are excel and python
- and i want to note that this class is
- definitely hard i have heard
- time and time again from people that
- it's the hardest course they took at
- university of florida
- but i've also heard just as many people
- say
- that it's the most rewarding class that
- they took that they got the most out of
- it they got the most
- tangible skills and results out of it
- so you know don't come into this course
- just you know saying i need an elective
- i just need to fill the slot
- uh only come into this course if you're
- truly interested in financial modeling
- and you're willing to
- work hard to be able to
- uh implement all of the projects and
- learn all the concepts and skills
- because definitely if you're not someone
- that's coming in with
- programming experience which i assume
- that most people don't
- but if you aren't you have your work cut
- out for you certainly
- so it's not an easy course don't take it
- lightly
- i'm here to help you along the way i
- want to give you all the support
- that i can so that you can learn this
- stuff but it is not an easy course by
- any means
- and coming to the prerequisites for the
- course
- so minimum business finance
- but even further i would recommend that
- you have taken
- the debt and money markets course the
- equity and capital markets course
- kind of the core finance courses
- because we really are focusing on how to
- build the models
- we really don't have time in the course
- to really cover the finance concepts so
- you should be coming in
- with strong knowledge in the concepts so
- that we can focus
- just on the actual model and if you are
- missing some of these skills
- and knowledge uh then i can recommend
- you some resources where you can fill
- the gaps
- but generally i would recommend that you
- have these three courses
- even though the minimum requirement is
- only business finance
- so coming to technical skills certainly
- you're going to need
- algebra which is true for mostly any
- finance class just to be able to
- you know manipulate equations uh that
- are within the models
- but further than that you need to have
- some excel
- experience coming in i'm assuming that
- uh the typical student coming in is at
- an intermediate level
- with excel and has zero python
- experience so that's kind of the average
- i'm trying to teach to
- so if you're someone coming in without
- any excel experience
- or with a small amount of excel
- experience
- i listed a few categories of skills that
- you should make sure that
- you understand and can apply so just go
- ahead and take a look at that list
- on the syllabus and make sure that you
- can
- uh you know do all these things in excel
- and you feel comfortable with them
- uh and if not i have some resources at
- the end of the syllabus that you can
- look through and
- fill in your gaps and knowledge
- on these categories and you know you can
- feel
- free to ask me any questions along the
- way
- if you're someone that has programming
- or python experience
- that's wonderful you're going to have
- definitely less of a learning curve in
- the beginning of the course
- but those are definitely not a
- requirement i'm assuming
- no experience with programming or python
- so uh the class we have three parts of
- the class
- the lecture videos like you're watching
- right now
- uh but then we're also going to have two
- more interactive components
- of the class uh so they're going to be
- lecture review sessions
- and interactive lab sessions so the
- lecture
- review sessions are about uh giving you
- an opportunity
- to ask questions from the lecture
- you know and you know as a group that
- way
- um you can see everyone else's questions
- as well
- and that way we still kind of get the
- interactive lecture experience
- even though the lectures are recorded so
- those
- uh lecture review sessions will also be
- recorded um so we'll have um
- posted uh after the sessions then we'll
- have
- everyone's questions and the answers to
- those questions
- uh so that you can um
- go through those and make sure that you
- understand everything
- and then the interactive lab sessions
- that's about
- giving you a time for
- uh everyone to be on a call and for
- people to be working
- on the problems for the class so whether
- that's the
- weekly uh assignments or if you
- get through all those then you can work
- towards the projects as well
- but it's just giving you an opportunity
- where you know you can
- discuss things with your classmates and
- you can
- ask me questions as well so i'm making
- my time available so that i'm a resource
- for you as you go to complete the
- problems
- certainly it helps a lot especially in
- programming if you're stuck on something
- just to have someone knowledgeable
- to just point you in the right direction
- it can really save you a lot of time so
- these lab sessions
- are very valuable and you should
- definitely take advantage of those
- as far as the projects in the course
- that's the main grade in the course is
- the projects
- and so it's going to be uh
- you know relatively larger projects
- you definitely want to allow yourself
- plenty of time to complete them
- um you know this is definitely where
- all the difficulty in the course comes
- in um
- is being able to learn enough of the
- skills to be able to complete these
- projects
- so the projects are fairly open-ended
- they just give you
- a certain problem that you need to
- create a model for
- uh and then it's you know up to you how
- you want to actually go
- and create that model um so it's not
- just going to be like
- here do here's how to do abc okay now in
- the project do a b
- and c with different numbers no that's
- not it at all it's it's going to be
- a completely different model you're
- you're learning a general pattern that
- you can then apply
- to any new uh situation
- and as far as um
- who you should be working with on the
- project so ultimately
- the projects are individual everyone is
- going to submit their own project
- and you should not be copying each
- other's work that means don't copy
- workbooks don't copy code and don't you
- know just sit there
- and do the exact same things next to
- each other
- now i do want to encourage you that you
- can
- still uh you know discuss things you can
- talk through the problems with your
- classmates i don't want you to have to
- go this completely alone
- so definitely don't feel like i'm saying
- you know you can't
- talk about the projects at all you can
- definitely talk about them
- and kind of discuss your approaches and
- challenges
- and how you've solved you know certain
- parts of it
- just don't you know give someone the
- guide to completely go through the thing
- the idea is that everyone should be
- completing their own projects so that
- everyone
- is getting the full learning experience
- and so you you know a lot of this course
- is going to be
- asking me questions uh you know i'm here
- as a resource
- for you uh to make sure that
- um you know whenever you have a doubt uh
- i can come in and make everything clear
- so the lecture review sessions those are
- those group uh video calls
- where you'll be able to ask questions
- and you know have the whole class
- participate in that
- and it'll be more you know general uh
- generalized
- uh concepts and and techniques at that
- point
- lab sessions are more about the problems
- you're working on a problem and you have
- a specific
- issue trying to complete that problem uh
- then i can help you out
- you know either one-on-one or you know
- one or
- me with you know just a small group of
- you
- and then you can email me and i'll email
- you back
- or we can make an appointment for a
- video call if necessary if we need a
- longer format
- to discuss something in more detail or
- you're not
- able to attend some of the other
- sessions
- and i just want to say before you ask
- questions make sure that you've watched
- any of the relevant
- lectures uh because if your question is
- just
- directly something that was covered in
- the lecture i'm just you know gonna say
- go watch that lecture video it covers
- this
- uh well
- as far as uh late policy
- um you can submit the projects
- late uh but it's you know ten percent
- off
- per day uh for each day that it's late
- um and that 10 kicks in
- um you know as soon as you miss the
- deadline so
- um the deadlines are are by midnight so
- it's due wednesday uh
- by midnight then if you turn it in
- thursday morning until the 1am
- you would be losing 10 um
- which i think you know is a pretty
- generous policy
- 10 per day because in the work world you
- often will not be given any latitude
- uh if you just don't hit your deadline
- you could get fired so
- i think this is quite the accommodative
- policy
- um so what should you do to be
- successful here um i definitely
- you know unless you're someone who's
- coming in with programming experience or
- python experience
- definitely you should take some time to
- do
- some outside learning on python
- you know as i said i am assuming
- everyone is coming in with no experience
- but this is not a programming class this
- is not a python
- class it's a financial modeling class
- and so we can only spend so much time
- on the basics of programming in python
- and so we'll go kind of quickly through
- those and to be able to get a better
- treatment of them so that you really
- understand
- what's going on which will make it that
- much easier to
- learn throughout the course uh you
- should definitely
- use some outside resources and i've put
- those resources at the end of the
- syllabus
- so definitely in the past students who
- utilized those outside resources
- just had so much of an easier time in
- the course because they weren't
- getting tripped up on just the basics of
- writing python code
- they kind of had that down and so they
- were able to focus
- on applying it to financial modeling
- rather than just learning the basics
- definitely you need to watch all the
- lectures um and
- the lectures kind of build on each other
- if you just try and
- jump in on the last few before a project
- is due you're going to be totally lost
- because
- it just keeps building and building so
- definitely
- go through in order
- and i would definitely encourage you to
- participate
- in the interactive lab sessions um
- you know that's that's huge to be able
- to uh
- you know work on the problem get stuck
- and then be able to get
- uh quick feedback from me that just
- makes your cycle so much faster and
- learning
- uh so you're not sitting there uh for
- hours struggling over something
- uh which would be simple for me to
- answer
- uh very quickly so um those
- lab sessions are very valuable and
- students who have utilized those
- to a greater degree have done better in
- the course in the past
- i will also be giving some practice
- problems so i would definitely recommend
- completing those and start the projects
- very early as soon as you can because
- there is a lot of work
- involved in the projects
- and definitely if there's any point in
- the course where you start to feel
- lost you start to feel behind
- you need to come and talk to me you need
- to email me
- because you cannot afford to get behind
- in this course
- as i said the material just keeps
- building
- we keep using what we've learned
- previously to go
- and do the next thing so if you get lost
- you're only going to get more lost as
- time goes on so as soon as you have that
- feeling
- you need to talk to me i can you know
- give you suggestions
- to rectify that so definitely
- do that rather than getting lost
- and then getting behind and then digging
- yourself into a hole that is very
- difficult to get
- out of
- so the grading in the class 80
- is uh these projects and 20
- is the lab exercises so you'll also be
- you know turning those lab exercises in
- weekly and those are mostly for uh
- sort of a completion grade um though
- you know if i look at it and think that
- you didn't give
- a full effort on it then uh
- you're going to lose points on the lab
- exercise
- but otherwise it doesn't necessarily
- have to be completely correct
- as long as you completed it and gave a
- good faith
- effort um in the lab exercise
- then um you'll get credit for that
- but the projects you know are completely
- uh graded
- on the basis of you know how accurate
- they are
- uh how readable they are and how well
- formatted
- uh they are
- you can see the grading scale here so
- take a look at that
- for any details on that as well as other
- grading policies you can review the
- syllabus
- um and so the main topics that we're
- covering
- um so the first is kind of the intro
- section and then we're going to
- focus mainly on corporate valuation in
- this course
- uh so in the intro section um after an
- overview we're going to go into
- learning the basic technical skills with
- excel and python
- and the first model that we're going to
- cover is a time value of money model
- uh you know looking at saving for
- retirement so that should be you know
- very tangible
- for everybody and i think it's an
- excellent place to start where we can
- focus on the model and you know the
- finance part of it
- should come easily for everybody since
- it's a basic
- finance concept then we'll go into some
- uh statistics tools that we need for
- modeling
- um and we'll learn about uh
- monte carlo methods um are another
- general technique
- in financial modeling and as far as
- where we're going to apply
- all these tools and skills and and
- patterns that we learn in the first part
- of the course
- uh we're going to look at a capital
- budgeting
- situation and then after that we're
- ultimately going to work towards
- uh the full discounted cash flow
- valuation
- of a stock um so that
- is everything uh getting the weighted
- average
- cost of capital estimating the free cash
- flows
- and putting that all together into one
- model
- that will ultimately be the final
- project in the course
- is producing this discounted cash flow
- valuation
- so that's the course and then i've also
- included here
- on the syllabus resources that you can
- use
- to again supplement or
- get started with your python and excel
- skills
- so i have excel as well as python
- resources here for you so again unless
- you are already coming in
- with programming experience python
- experience and strong excel experience
- i would highly recommend that you take a
- look at these resources
- to be able to uh get an outside
- perspective and get the basics
- of these tools uh so that you can focus
- more on the financial modeling part of
- the course
- so that is the syllabus next time we
- will come back and talk about
- what is a financial modeling and kind of
- the introduction to the actual
- course content so thanks for listening
- and see you next time
What is a Financial Model?¶
Notes¶
A model is simply a repeatable process which converts inputs to outputs
The process might be as simple as a single calculation or as complicated as trying to value a large multinational company
There can be one or many inputs and outputs
A model is a logical and mathematical construct, it has nothing to do with Excel or Python. These are just tools we can use to implement the model
Transcript¶
- hey everyone
- nick dear brotis here teaching you
- financial modeling
- today i'm here to talk a little bit more
- about what we're focusing on in this
- class
- and what is a financial model
- so this class is
- a skills and technique based
- course so it's not let's go learn the
- laundry list of financial models
- it's more let's learn a general process
- and the skills necessary
- to be able to build financial models so
- you can go out
- and build whatever model you choose
- um so
- generally we're going to look at you
- know
- fairly simple uh models
- but that'll be just the base model and
- then we're going to extend that model
- in a number of various ways like
- sensitivity analysis scenario analysis
- monte carlo simulation
- these kind of things that are going to
- give you a
- much greater understanding of the
- problem
- than just doing the basic model
- for the problem
- so techniques and skills over
- concrete models and
- focus on extensions
- to the models and being able to uh
- really uh you know whatever problem you
- happen to be modeling
- really get a good understanding of
- everything that's going on
- by being able to model kind of the
- variance of your result
- as well as the original expected result
- so what is a financial model
- what is a model in general so
- we can think of a model as something
- actually
- very simple it's just a process
- which converts inputs to outputs so
- you know that's a very general
- definition but
- you know you can have a model for nearly
- anything
- so we need a general definition
- um so when you view it in this kind of
- context
- that a model just takes some inputs and
- converts them
- to outputs that really
- gives us a concrete uh
- way of thinking about the model um
- rather than you know just thinking about
- you know we're doing evaluation of a
- company we're estimating the weighted
- average cost of capital all these
- particulars
- ultimately it's just to convert your
- inputs
- to outputs
- so we can make this a little more
- concrete by looking
- at a couple examples of models
- so here first we can think about a
- retirement problem um so this
- is a problem where um
- you know someone is saving for
- retirement they're earning
- uh wages over time and they're saving a
- portion of that
- and they want to save that and invest
- that
- money so that they can then retire
- at the end of life so
- figuring out how much uh this person
- actually needs to save to be able to hit
- their
- retirement goals um
- is you know the problem that we're
- thinking about modeling here
- so when we um you know think about the
- real world problem that we are dealing
- with
- um we can also kind of split that
- real world process
- into the same kind of structure
- so we're going to have inputs into the
- real world process and we're going to
- have outputs
- and our model is ultimately going to try
- and represent
- that middle piece the process so
- um in the real situation for the
- retirement problem
- uh someone is earning wages from their
- job
- and then they're saving a portion of
- those wages so those
- are our inputs uh you know how much are
- they bringing in
- um in cash and then how much of that are
- they actually putting into
- savings and then the the process
- which converts the inputs to the outputs
- for the retirement
- real problem is the investment process
- right
- uh you know buying the investments um
- and then holding them
- and earning um you know dividends and
- capital gains
- on those investments ultimately selling
- those investments at a later point
- uh that's the real world process and
- then the output or result from that
- process
- is that this person you know has a
- certain amount of cash
- from those investments and so they can
- retire as a result
- so when we think about modeling this um
- so our model is going to take the place
- of the real world process
- so our model is basically trying to
- capture uh
- this investment process right uh you
- know whatever
- how much money is coming in investing
- that in whatever
- uh securities earning a certain return
- on those
- uh you know selling those at a later
- date
- um all these kind of things could go
- into
- the model and then the inputs to the
- model
- would be our you know tangible things
- that we can measure
- which capture uh you know the inputs to
- the real world problems so
- certainly the the cash flows they're
- getting from their wages
- we can measure that we can think about
- their
- how much they're saving in terms of a
- savings rate of what you know what
- percentage
- of their wages are they saving in each
- year
- um and as an input into the investment
- process we can think about the interest
- rates
- that this person is going to earn on
- their investments
- and then you know coming out as a result
- of the model
- we have the future value of the cash
- flows which again
- represents you know how much cash this
- person is going to have
- when they retire or you know if we have
- a specific
- amount of desired cash uh then we could
- figure out how long would it take for
- this person
- to get enough cash to retire
- so you know the model is all about uh
- you know approximating some
- real world process and here is a
- relatively simple
- real world process but the same thing
- can be applied to
- more complicated uh situations
- so definitely more complicated is
- thinking about how to value
- a company especially like a large you
- know multinational corporation with all
- these different business segments
- certainly it is complex to come up with
- a
- relatively accurate valuation for that
- company
- so the real world situation that we're
- modeling
- is actually the business operations
- of this uh you know whatever company
- that we're valuing
- so if we think about uh say microsoft
- uh you know microsoft is primarily in
- the business of
- selling software right um and so
- uh you know the inputs to uh
- the real world situation here is that
- microsoft is creating that
- software and then the process uh
- is they sell that software and the
- output is that
- they get uh the cash proceeds um
- from selling that and that leads to
- the stock reaching a certain price as
- a result so then if we're going to think
- about
- building a model for evaluation of
- microsoft
- uh what would we think about so you know
- again
- for the inputs on the model it has to be
- what we can actually
- tangibly measure um or at least
- uh you know guess at so these
- you know have to be numeric values for
- the most part
- um and so you know microsoft creating
- software is
- is quite a big thing um we would have to
- come up with more tangible things that
- go into creating that software
- so you know how much are they having to
- pay in salaries
- uh for the software developers to
- produce that how much
- uh are they putting into marketing to
- sell the product
- um you know how much did they pay to
- finance the company to get the capital
- to
- to create this software in the first
- place
- uh you know how much is uh the
- the sales growing um all these kinds of
- things
- uh would go into the inputs of this
- valuation model
- and then the model um would be capturing
- um you know the business um
- so it can be you know from a couple
- different perspectives you can have more
- of an operational
- model where you try to actually dig into
- all their operations and come up with
- cash flows and everything or it can be
- just you know based on the
- top line uh financials it's a more
- aggregated view
- but ultimately the model is trying to
- capture uh the business process
- that uh microsoft goes through to
- generate value
- uh for its shareholders and then the
- outputs from our model are going to be
- the stock price and
- and returns on that stock
- so regardless of the complexity of the
- underlying
- problem that you're dealing with you can
- ultimately boil it down to
- their inputs their outputs and there's
- some process and then when we go to
- model that we think about what tangibly
- can we measure
- in those inputs and outputs and how do
- we approximate this process
- uh with a model that's the general
- idea so that
- concludes thinking about what is
- a model and basically what we are
- talking in this class
- so next time we'll come back to talk
- about the tools and skills
- that we're going to cover as part of
- this course
- so thanks for listening and see you next
- time
Tools and Skills¶
Notes¶
We will implement models in both Excel and Python in this class
It is necessary to learn programming to build real-world custom models
Out of programming languages, people love Python for its short(er) learning curve, readability, power, and flexibility.
Learning programming and Python has many applications outside financial modeling and proves technical competency on a resume
Python, like (nearly) any other programming language, is text-based and lives in a terminal
While it does get much easier to learn more languages after your first, if you’re going to pick just one, it should definitely be Python over VBA
Excel is not going anywhere. It has its problems, some of which are major, but it is so widespread and people are used to dealing with these problems
Transcript¶
- hey everyone
- nick dear british here teaching you
- financial modeling
- and today i'm here to talk to you about
- what are the tools and skills that we're
- using in this class
- you know python and excel why do
- i choose them for the course and why do
- i think that they're the
- most appropriate tools and skills to
- learn for financial modeling
- so let's go ahead and jump in
- so um
- you know a lot of people you know do
- financial modeling
- primarily just in excel but i've chosen
- to
- uh use python in this class so why
- are we going after python as
- a tool to use so
- if you want to do anything more advanced
- in financial modeling you have to go to
- programming there's no way
- to be able to implement some of the
- intricacies
- of the detailed situations
- of the models that we're building
- without
- going to programming so
- you know it becomes excel alone
- is not going to be enough you have to go
- to some kind of programming
- now excel does have its built-in
- language vba so that's another option
- but we'll talk about why i believe
- python is a better choice to learn
- as a language for your financial
- modeling
- so why why python out of programming
- languages
- so i think this this comic here
- illustrates things uh well about kind of
- the general
- feeling about python in the programming
- community
- so you can pause the video to read that
- but the main idea here is just that uh
- it's it's pretty easy to pick up python
- it doesn't require
- a lot of structure a lot of knowledge
- of you know computer science concepts or
- anything like that to be able to
- complete some simple tasks you just need
- very little code to do that very little
- structure
- so that makes it uh quite a bit easier
- for people to get started with
- python than with other programming
- languages
- and this comic also you know kind of
- highlights the flexibility and power
- of python that there's this rich
- ecosystem
- of open source packages that you can use
- which kind of supercharge the
- capabilities
- of python so it's not like excel where
- you know microsoft
- develops excel so it's whatever features
- microsoft
- is able to build into excel are the ones
- that you can use
- uh you know there are plugins but you
- know there's not a whole ton of them
- whereas python at its core is an open
- source
- language built by the community um
- and then there's also a community of
- uh packages around python which extend
- the capabilities of
- python and today there are over 250 000
- different packages that you can add to
- python uh
- just free and open source out there
- waiting for you to use
- uh and so there's a ton of stuff that
- you can do the flexibility
- is enormous with python the flexibility
- and the capabilities
- now why for finance specifically
- you know again um i kind of hit on it
- already but out of the
- mainstream programming languages that
- are out there it's definitely the
- easiest to learn
- because of that uh lack of structure
- um needed and a lot of cases
- um and it's already uh you know growing
- very quickly in the finance
- industry um it's definitely uh becoming
- the
- the top uh programming language in the
- financial industry
- and definitely for financial modelers
- so you won't be alone when you learn
- python
- and you know i mentioned these 250 000
- packages that are out there that make
- your life
- so much easier to do all sorts of
- different things uh
- you know learning python is going to be
- useful for you
- you know for many things outside of
- this course and financial modeling
- so you know some of the other categories
- where python definitely excels
- are you know data science doing all
- kinds of analysis
- and visualization of data
- algorithmic training you can build your
- own
- little trading bots which execute uh
- strategies for you
- uh scripting um so you know completing
- some kind of automation kind of tasks of
- just making your life easier
- um devices
- you know like internet of things iot
- devices
- python is on those as well
- web development certainly python is used
- extensively
- in the web um you know some
- uh very popular um sites are built on it
- you know such as you know instagram is a
- good example
- uh built totally on python
- web scraping is about you know
- collecting
- data from websites in an automated
- fashion
- so you know a website may have 3000
- different pages that you want to collect
- data from
- you can automate all of that with python
- and actually even these uh slides
- that you're viewing right now i
- generated with
- python and all of the um
- like documents and everything in the
- course i'm generating all of those with
- python um and this is a very
- uh small list compared to the
- capabilities uh these were just some of
- the categories that i wanted to
- highlight
- but the high level is you know you learn
- python and you're able to go
- in all these different directions should
- you want to go to them
- um versus you know we'll talk more about
- vba but that
- kind of constrains the amount of choices
- that you have
- another great thing about python is it
- is the fastest
- growing programming language and
- depending on the ranking
- you know it's between one and three on
- all of the rankings
- um and within the next couple of years
- it's gonna be number one
- on all the rankings because it is
- growing so much faster
- than the other top programming languages
- so um you're not alone
- with adopting python so many people are
- doing it around the world
- and it will be the world's number one
- programming language
- very soon by all measures
- so um some more advantages of python
- i mentioned it already but it's
- completely open source
- that means it's totally free uh that
- means that
- even the code that creates python that
- creates the language as well as creates
- uh
- all these these packages this extra
- functionality that we're gonna add to
- python
- all that source code is just out there
- and able for you to use so if you really
- like a project a package that's out
- there
- but you really wish it had some other
- feature you know you can potentially
- just take that code and you can add that
- feature
- yourself because that's all completely
- free and open
- and you can contribute that back to the
- library and maybe they'll add it as a
- feature for everybody so
- you know it's a whole community of
- people that come together
- uh kind of in their free time to develop
- these tools that everybody in the world
- can use
- and one of these biggest focuses of
- python language is to make it as
- readable as
- possible so it's almost
- like just reading english uh there's not
- a whole lot of special symbols or crazy
- uh characters or anything in there um
- it uses uh white space rather than um
- you know curly braces and things like
- that and so
- it's it looks very clean it's it's easy
- even if you're not
- a python programmer to kind of read it
- and understand what's going on
- so the readability is huge for beginners
- as well as
- uh you know uh just you know saving time
- over time being able to
- look at someone's code and just
- understand it fairly easily
- um and you know going along with the
- flexibility
- of python so it's uh
- there are a lot of features in python
- um and so it can grow to the point where
- you know a lot of experts do use python
- as their primary language
- because it has all the kind of features
- that they would want
- you know being programming experts but
- you're not required to use
- all of those features you can use as
- little as you want to use
- so you know it's easy for beginners to
- pick it up you don't have to have
- all this structure that is important
- for you know building large scale
- applications you can just write a couple
- lines of code and get something done
- but it does allow you to also use all
- that structure if you want to go
- and build something big so
- you know you can kind of start small
- with it and over time you can add more
- and more things
- which improve your process
- and another nice
- feature of python this is by way of one
- of these packages that we can add to
- extend the functionality
- so there's a deep integration of python
- with excel
- we can run python code and make excel do
- things
- and we can run python code from within
- excel
- so you know the applications of that
- will become much more clear as we get
- into the course
- but you know basically you can use
- python instead of vba you don't even
- have to worry about vba you can do all
- the same things
- as vba um
- but it's also python you can use it for
- other things after you've learned it
- so what's the drawback of
- using python um well here i think is the
- biggest
- drawback uh and this is not unique to
- python it is
- uh just the nature of going to
- programming over just using basic
- excel that it's inherently
- uh text-based and
- um inherently there's no
- like interface to using it right like
- you type
- some text and you might get some text as
- the output
- so you know you just look here you stare
- at the terminal
- that's probably intimidating for a lot
- of people
- um but this is kind of where
- python lives as well as you know any
- other
- programming language now we are going to
- talk about
- uh things that have built been built on
- top of python that are going to make it
- nicer to use
- we're not actually really going to be
- working in a terminal
- primarily we're going to use uh what's
- called
- jupiter as a project which gives a nice
- interface to python
- but still at its core you know it's just
- a text thing
- um and so you know that can be
- a bit of a shell shock for people that
- are used to just using
- excel you know you just hit okay i gotta
- type text now to do things
- what is going on
- so no graphical interfaces is basically
- what i'm getting at there now i say by
- default because there are
- uh interfaces that you can add and use
- and we're going to use jupiter
- but by default you know you're just
- working with text
- another disadvantage is you know for the
- most part
- people know excel uh you know you can
- kind of expect
- that pretty much anyone you're working
- with in a business environment is gonna
- have
- a basic working knowledge of excel at a
- minimum
- uh but that is not there for python yet
- i think we're going in that direction i
- think more and more people
- are going to uh know how to program in
- python
- over time uh but as of now you know
- still it's a minority of people who
- actually know how to use python
- um so that can make it a little more
- difficult to work with other people
- if you've uh you know programmed your
- model in python
- and then your boss says hey you two need
- to work together
- uh but this other person doesn't know
- any python that's going to be
- difficult for them to come and work on
- your model
- and you know somewhat going along with
- well
- you know you've just got text to work
- with it can be a little bit harder
- to get started on a project uh you know
- it's definitely more open-ended
- you can just sit there staring at the
- blank
- editor like what what do i type now
- where do i go first
- um but you know that just comes with
- experience the more that you work with
- it the more that you're gonna know
- uh what you should do so definitely
- by the end of this course uh you'll not
- be feeling that pain so much and you'll
- have a good idea
- how to get started on any given project
- so why not use vba i mean that's already
- built in
- to excel uh you know we're already
- talking about how everybody uses excel
- so you know why not just use the thing
- that's already there
- uh to do our programming right um
- so the biggest thing i think here is
- highlighted by this picture
- or maybe the second biggest thing is
- that uh
- it's kind of hard to read it's not it
- doesn't have nearly as much of a focus
- on readability as python does
- um you know just looking at this code is
- kind of hard to understand
- what's going on
- um so that readability you know it's
- going to cost
- you time in terms of you know if you
- have to work on someone else's code
- you've got to go and understand
- all this stuff um and it's even going to
- be difficult for yourself when you come
- back to an old project and you think
- what is going on here now i have to
- understand my code again it's just more
- difficult to read
- but you know just as important maybe
- more important is that
- you know vba you can automate all sorts
- of stuff in microsoft office so it's not
- just excel you can do word you can do
- bower
- powerpoint but it's microsoft office
- only right you're not going to go
- and build instagram with vba you're not
- going to go and do actual data science
- and analysis
- and all these things with vba unless you
- you know really want to torture yourself
- [Music]
- and so by learning python
- which is even easier to learn than vba
- then
- you have so many more capabilities than
- if you had just learned vba
- instead um
- and you know we mentioned a little bit
- earlier that python can basically be a
- vba
- replacement in excel um so python can do
- everything that vba can
- it even you know has uh a package which
- you know gives all the functionality of
- vba
- but it can do so much more and vva
- can just do vba so why spend time
- focusing on you know just a subset of
- what python can do and spend even longer
- to learn that subset as vba when you
- could just learn python
- instead
- and then you know why is this not just
- 100 python course why are we using excel
- as well um so
- excel is everywhere everyone knows how
- to use excel as i said
- and you know so much of the data that
- you would work with
- and any organization is stored in excel
- spreadsheets so it's kind of hard to get
- away
- from excel and it's ubiquitous
- um so and then there are some you know
- advantages
- um just on the nature of the tool um
- you know it's a very visual experience
- using excel right you do something and
- you
- see the result of that immediately
- so that can make it quicker to
- kind of learn how to use it and do some
- simple things
- but you know when you want to go and do
- something complicated
- then uh you start to run into
- difficulties and excel
- and you know looking at a particular
- value in excel is really easy you just
- click on the cell
- right um and you know you can trace back
- the
- the dependencies of that cell um and
- everything
- so it's pretty easy to look at and
- figure out what's going on in one
- particular
- area of an excel spreadsheet
- but there are certainly disadvantages
- with excel so
- you know those who have built
- complicated things in excel
- before probably uh you know
- this this picture probably dredges up
- some some feelings for you
- um that you know as you add more and
- more
- uh worksheets that are all linked
- together it all just
- starts to become complicated and
- unwieldy uh you might have multiple
- workbooks that are referencing each
- other
- um it's not clear you know
- where everything starts where everything
- ends everything is just kind of linked
- together in various ways
- and so it's really hard to understand
- you know i have a particular number here
- what is the whole process that got me
- there was it you know reference from
- another calculation which referenced the
- data from another workbook
- um which you know so it can be
- difficult you know at a high level view
- to understand
- what's going on in a complicated excel
- model um
- and part of uh why that's the case
- is because you know the the code
- the formulas that you're putting into
- the cells
- and the view the kind of the the what
- you're seeing the output
- of the cells uh it's all mixed together
- right you see
- just the output normally you only see
- the code or formula
- if you click into a cell so that
- the the code is inherently hidden and
- you
- you kind of have to go digging to
- understand
- where a particular value came from
- but it becomes even worse as soon as you
- start
- layering in vba uh because
- it's not that bad to you know look at a
- cell
- look at what cells it's referencing and
- kind of just follow back
- until you get to the the raw inputs and
- then you can understand the whole
- process
- that produce this output uh but as soon
- as you layer on vba
- that's just this whole other separate
- thing just going on in the background
- and you're only going to know that vba
- is going on at all if you
- you know go into the vba editor and then
- you start to read that code
- um and then look at the code and
- understand where it's being applied
- in relation to all the cell formulas and
- everything
- um and so it's kind of this invisible
- background thing that can do things that
- you're not expecting
- um and so having both the cell formulas
- and vba
- going on in the background can make it
- very confusing to understand
- the exact process that goes from inputs
- to outputs
- um it's also quite easy to
- make a certain type of mistake in excel
- you know maybe because you know so much
- of excel uh
- you know you're gonna like drag to auto
- complete things
- to do the same thing for every row or
- every column
- um and then you know you accidentally
- just type something in one of those
- cells
- and it overwrites what you had there um
- and it can be really easy to miss that
- especially if you have thousands of
- cells
- going on there's just one of them which
- is different
- um and so those kinds of mistakes can be
- very very difficult to track down
- whereas it would be harder to make that
- kind of mistake
- in a programming language as things are
- generally
- more generally applied
- um and certain tasks uh which
- um are really simple to do in python
- um become very complex
- and excel and we'll definitely look at
- examples of those
- in the course and that is you know the
- primary uh
- reason is that of going to a programming
- language is excel is just not
- going to be able to accomplish
- everything that we want to do so you got
- to go to a programming language
- vba or some other language and we're
- choosing python
- for all of the reasons mentioned
- so that's uh the tools and skills that
- we are covering in this course and why
- we're focusing on these rather than
- some of the other options that are out
- there
- so next time we will look at how to get
- python installed
- on your machine and that will conclude
- our introduction
- segment of the course so thanks for
- listening
- and see you next time
Installing Python¶
Notes¶
Watch this process to learn how to install Python
You will only need to complete this once on a given computer
The “Add Anaconda to my PATH environment variable” is very important, it will warn you that it could cause issues but it won’t for our purposes, and if you leave it unchecked you may have to reinstall Python later in the course
Be sure to test your installation is working
Transcript¶
- hey everyone
- nick dear burtis here teaching you
- financial modeling today we're going to
- talk about
- installing python on your computer
- so should be a quick video
- just looking at the install process for
- python
- and so there's a lot of different ways
- to actually install python
- being that it's open source but the way
- that i'm
- recommending for the course is to use
- anaconda
- so anaconda is a package distribution
- that comes along
- with python and it gives you
- already pre-included already downloaded
- and set up
- uh most of the additional packages
- that you would want to add to python
- to be able to do financial modeling and
- general data analytics
- so it's a distribution focused on
- scientific computing and includes
- plenty of packages which help out with
- those
- objectives so you just
- go to the anaconda website here
- and that would bring you to this kind of
- page
- and take you to this page
- and so you just click download
- and then it'll bring you to the where
- you can download the installer
- so make sure that you pick the one for
- your appropriate system
- uh python38 here um
- and i already went ahead and downloaded
- this so we wouldn't have to wait
- um so then you can go to run the
- installer
- and you know this is gonna look slightly
- different on a mac but
- same basic process here so you just go
- through the installer
- and you know most the stuff you can just
- go through the defaults are going to be
- fine
- um you know i already
- have it installed so i had to pick a
- different path there but you won't have
- to do that
- but the one thing that you do have to do
- which
- [Music]
- is not there by default is you do have
- to check this option here add anaconda 3
- to my path
- environment variable and you know the
- installer
- generally does not recommend doing this
- but i promise you it's not going to
- break anything
- as far as the course it's going to be
- fine um
- and it is necessary for later on in the
- course when we're going to do the
- integration between python and excel
- so make sure that you have this checked
- as you go through
- otherwise you're probably going to need
- to actually
- reinstall python later on in the course
- once we need it
- and that's you know just an annoying
- extra step to go through
- whereas you check this option here then
- you
- just install python once you're going to
- have it for as long as you have that
- computer
- and you can use it for the course and
- for anything else that you want to do
- so then you know with both these boxes
- checked you would just go and hit
- install uh that's that's where i'm gonna
- finish here on this because i already
- have it installed on my machine
- but then you know it would just you know
- do the regular kind of progress bar
- across the screen and then when that
- finishes
- you'll have python installed so how can
- you
- check to make sure that you have python
- installed
- so on windows
- so you can go into the windows menu
- and type cmd and you're going to see
- command prompt
- come up there so if you click
- command prompt then you should be able
- to type python
- in the command prompt and then that
- should get you to this kind of screen
- here where it says python and the
- version it should say 3.8 point
- something for you
- and it's going to have these three lines
- or three um
- greater than signs um here and you can
- type things
- on this prompt so if you get to this
- um then the install
- has worked correctly if you're on a mac
- uh
- same exact process only instead of
- searching cmd
- you're going to search for terminal in
- your app search on
- mac so it's just instead of being called
- command prompt it's called terminal
- but then once you get into it you're
- again just going to type python
- hit enter and then it should take you to
- this kind of output here where it shows
- the python version
- as well as this prompt that you see here
- so if you can do that then you have
- python installed properly
- and next time we will look
- at how we can actually start applying
- some of this
- um we will start to get into
- the basics of excel and python
- so that concludes how to install python
- so thanks for listening and see you next
- time