FMP

FMP

Enter

Financial Modelling Prep provides a free stock API, financial statement API, and lots more valuable financial data. Before you can start taking advantage of our

How to create your own Python environment

-

twitterlinkedinfacebook
blog post cover photo

Image credit: ThisisEngineering RAEng

Financial Modelling Prep provides a free stock API, financial statement API, and lots more valuable financial data. Before you can start taking advantage of our service you must first set up the environment where you are going to write your code. In this guide, we will explain exactly how to do this:

  1. Download and Install Anaconda
  2. Launch Jupyter Lab and Create Your Folders
  3. Launch a Notebook and Start Coding!

Step 1: Download and install Anaconda

Anaconda is one of the leading python and data science platforms. It enables you to be able to have your own Jupyter Notebook style environment to write your code and run your analysis. The Jupyter Notebook environment is great for beginners to intermediate coders because it allows you to run individual blocks of code and get their specific outputs. Everything in one notebook will be connected so it makes it much easier to debug your code and figure out the exact location of any errors. Anaconda enables you to create your own Juptyer Notebook environment that will store your files locally on your PC or Mac. Here are the instructions from Anaconda on how to install it on your Mac or Windows PC:

Windows Install Guide:

    1. Download the Anaconda installer
    2. RECOMMENDED: Verify data integrity with SHA-256. For more information on hashes, see What about cryptographic hash verification?
    3. Double click the installer to launch.
    4. Click Next.
    5. Read the licensing terms and click “I Agree”.
    6. Select an install for “Just Me” unless you're installing for all users (which requires Windows Administrator privileges) and click Next.
    7. Select a destination folder to install Anaconda and click the Next button. See FAQ

install

    1. Choose whether to add Anaconda to your PATH environment variable. We recommend not adding Anaconda to the PATH environment variable, since this can interfere with other software. Instead, use Anaconda software by opening Anaconda Navigator or the Anaconda Prompt from the Start Menu.

install

macOS Install Guide:

    1. Download the graphical macOS installer for your version of Python.
    2. RECOMMENDED: Verify data integrity with SHA-256. For more information on hashes, see What about cryptographic hash verification?
    3. Double-click the downloaded file and click continue to start the installation.
    4. Answer the prompts on the Introduction, Read Me, and License screens.
    5. Click the Install button to install Anaconda in your ~/opt directory (recommended):

install

    1. OR, click the Change Install Location button to install in another location (not recommended). On the Destination Select screen, select Install for me only.
    2. Click the continue button
    3. A successful installation displays the following screen:

install

Step 2: Launch Jupyter Lab and Create Your Folders

Now that you've installed Anaconda, it is time to launch JupyterLab and start making your environment your own. First you will need to open the Anaconda Navigator. Don't be scared by the seemingly scary command centre code it runs when you open it - this is normal and won't harm your computer. Once you've launched Anaconda Navigator you'll be asked to make an account which is not necessary to get started so we recommend you ignore this. You should get to a screen like this:

install

Click the Launch Button underneath JupyterLab which is highlighted above. This will take you to a new tab on your preferred browser and will look something like this:

install

Once successfully launched, you'll want to create a new folder and name whatever makes the most sense to you (We called ours FMP because we're biased!). Below you'll see that the new folder button is highlighted:

install

After you've created the main folder that you'll store all your work, spend some time thinking about how to organize your subfolders. We recommend creating a new folder for each project you take on and putting all your work for that project in that folder. This will likely be multiple Jupyter notebooks and other files such as CSVs. Below is an example of the folder structure we have used:

install

Step 3: Launch a Notebook and Start Coding!

So now your environment is all set up, it is time to start writing some code and performing analysis using Python. To start, perhaps create a folder called “Learning” or something similar to store all of your notebooks used to get started and learn new skills. To open the folder, simply double click it. To navigate back press the name of the main folder. To open your first notebook click the tile beneath the Notebook header that says “Python 3” and a new notebook will open!

install

By default, this notebook will be untitled. To rename the notebook either right-click the file in the left-hand side or at the top of the tab and then select rename. These two are highlighted below:

install

To make sure Jupyter is working properly always run a simple test bit of code and make sure the output works well. For example, try typing the following into the first cell:

x = 7 * 5

x

Then hit enter.

You should of course get an output of 35

install

If you want to create a new notebook, click the + icon in the top left corner of Jupyter and it will bring up a new launcher where you can follow the steps above to begin a new notebook.

Rounding Up

So that's how you can get your Python coding environment set up and start coding. First, download and install Anaconda. Then, launch JupyterLabs and create your folder structure. Finally, launch your first notebook and test it works before beginning your coding adventure!

Other Blogs

Oct 31, 2023 8:03 AM - Parth Sanghvi

FCFF vs FCFE: What's the Difference?

Free cash flow to the firm (FCFF) and free cash flow to equity (FCFE) are two of the most important metrics used in financial modeling. Both metrics measure the amount of cash that is available to a company's shareholders and creditors, but there is a key difference between the two. FCFF measures...

blog post title

Nov 25, 2023 6:39 AM - Parth Sanghvi

DCF Valuation vs. Comparable Companies Analysis: Choosing the Right Valuation Method

Choosing the Right Valuation Method: DCF vs. Comparable Companies Analysis Introduction: Valuation methods play a pivotal role in determining the fair value of a company, aiding investors in making informed investment decisions. Two commonly used methods, DCF Valuation and Comparable Companies A...

blog post title

Dec 23, 2023 2:19 AM - Parth Sanghvi

Understanding the Limitations of DCF Analysis: A Guide to Overcoming Challenges

Introduction: Discounted Cash Flow (DCF) analysis stands as a cornerstone in valuing investments, yet its efficacy is contingent upon various assumptions and methodologies. While a powerful tool, DCF analysis comes with inherent limitations and challenges that investors must acknowledge to make i...

blog post title
FMP

FMP

Financial Modeling Prep API provides real time stock price, company financial statements, major index prices, stock historical data, forex real time rate and cryptocurrencies. Financial Modeling Prep stock price API is in real time, the company reports can be found in quarter or annual format, and goes back 30 years in history.
twitterlinkedinfacebookinstagram
2017-2024 © Financial Modeling Prep