Please help! Does anyone got a list of financial codes like .merge, .drop etc. for Jupyter

I am new to python and trying to understand it for the purposes of financial data analysis which we previously used to do using Excel and other software. However, it’s hard to remember all these formulae. In every software, including excel we have a bank of formulae where if you have forgotten the syntax you can always go and check. Is there something like that in python… ?? I am sure there must be a library, so please let me know about that… but also, I want to avoid getting overwhelmed. So, if possible, can someone guide me to some specific place from where I might be able to get precise financial formulae… if that is not something you know but you know something else that might help… please do share… Thank you…

It’s a great step to transition from Excel to Python for financial analysis!

You are absolutely right that in Python, there isn’t one simple “formula bank” like in Excel. Instead, formulas are implemented using powerful libraries that contain specialized functions.

For financial data analysis, you’ll primarily use three key libraries.


1. :snake: Pandas (Data Structure and Manipulation)

Pandas is the foundation for almost all data analysis in Python. It’s the equivalent of working with worksheets and tables in Excel.

  • Key Structures:

    • DataFrame: A two-dimensional table with labeled rows and columns (just like a financial spreadsheet).

    • Series: A single column of data.

  • How it Replaces Formulas: Simple calculations aren’t done with a formula name, but by applying an operation to a column (Series) or the entire table (DataFrame).

Excel Formula Example Pandas Equivalent (Conceptual)
AVERAGE(B2:B100) df['Price'].mean()
STDEV.P(C2:C100) df['Returns'].std()
SUM(D2+E2) df['NetIncome'] = df['Revenue'] + df['OtherIncome']

2. :1234: NumPy (Numerical Computing)

NumPy is essential for high-performance mathematical operations. It’s what Pandas uses under the hood to handle large arrays of numbers efficiently.

  • Use Case: You’ll use NumPy for more complex mathematical concepts and statistics like matrix operations, logarithms (e.g., for calculating Log Returns: np.log(df['Price'] / df['Price'].shift(1))), and advanced array filtering.

3. :bullseye: Specific Financial Formulae (Technical Analysis)

If you’re looking for pre-built functions for common financial indicators, especially those used in Technical Analysis (like Moving Averages, RSI, Bollinger Bands, etc.), the following library is the most precise “bank” you’re looking for:

Pandas-TA Library

This library is designed specifically to calculate hundreds of technical analysis indicators and easily add them as new columns to your Pandas DataFrames.

Financial Formula / Indicator Pandas-TA Function Example
Simple Moving Average (SMA) df.ta.sma(length=20, append=True)
Relative Strength Index (RSI) df.ta.rsi(length=14, append=True)
Bollinger Bands (BBANDS) df.ta.bbands(append=True)

Guidance to Avoid Feeling Overwhelmed

  1. Master Pandas First: Focus 90% of your initial time on learning how to load, clean, select, and manipulate data using Pandas DataFrames. This is the structure you’ll apply all formulae to.

  2. Use Documentation as Your Bank: The equivalent of checking the formula bank is looking at the official documentation for the specific library you are using (e.g., Pandas-TA Documentation).

  3. Start Simple: Begin by calculating Daily Returns and Simple Moving Averages. These two concepts will teach you how to handle time-series data and apply functions to columns.

Would you like me to show you a simple Python code example for calculating the Daily Percentage Return on a stock price using Pandas?