Registry / data / ft-pandas-ta

ft-pandas-ta

JSON →
library0.3.16pypypi✓ verified 87d ago

ft-pandas-ta is an active Python library (version 0.3.16) that extends Pandas DataFrames with over 130 technical analysis indicators. It functions as an easy-to-use Pandas extension, allowing indicators to be called directly from DataFrames or as standalone functions, with reported correlation tested against TA-Lib. This project is a fork of the popular `pandas-ta` library, maintaining a healthy release cadence.

pip install ft-pandas-ta
INSTALL
IMPORT
SIG · FT-PANDAS-TA
F
ft-pandas-ta
datapythonv0.3.16
Install
7.7s avg
Import
884ms
Disk
166MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.16 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.902s · 166.3MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 7.7s · import 0.865s · 159MB
166MB installed
● package 166MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ta
import pandas as pd import pandas_ta as ta
Common alias for both standalone functions and to enable the DataFrame accessor.
DataFrame.ta
import pandas as pd import pandas_ta as ta df = pd.DataFrame() # Your DataFrame df.ta.sma(length=10, append=True)
from ft_pandas_ta import ta # Then df.ta.sma()
While 'from ft_pandas_ta import ta' might work for standalone functions, 'import pandas_ta as ta' is the canonical way to import the library and automatically enable the DataFrame '.ta' accessor. The 'ft_pandas_ta' package uses 'pandas_ta' as its internal module name.

This quickstart demonstrates fetching historical stock data using `yfinance`, then calculating a Simple Moving Average (SMA), Relative Strength Index (RSI), and Bollinger Bands using `ft-pandas-ta`. It showcases both appending indicators directly to the DataFrame and returning them as a Series.

import pandas as pd import pandas_ta as ta import yfinance as yf # Common dependency for fetching financial data # Fetch sample financial data df = yf.download('AAPL', start='2022-01-01', end='2023-01-01') # Ensure the index is a DatetimeIndex (yfinance does this by default) # For other data sources, you might need: # df.index = pd.to_datetime(df.index) # Calculate a Simple Moving Average (SMA) and append to DataFrame df.ta.sma(length=20, append=True) # Calculate Relative Strength Index (RSI) and get it as a Series rsi_series = df.ta.rsi(length=14) # Calculate Bollinger Bands and append multiple columns to DataFrame df.ta.bbands(append=True) print(df.tail()) print(rsi_series.tail())
Debug
Known issues
breakingOlder versions (prior to 0.3.16) might encounter `DeprecationWarning` related to `pkg_resources` due to changes in Python packaging.
fix
Upgrade to `ft-pandas-ta` version 0.3.16 or newer: `pip install --upgrade ft-pandas-ta`.
affects: <0.3.16
breakingWhen upgrading to NumPy 2.0+, older versions of `pandas-ta` (and potentially `ft-pandas-ta` if not on 0.3.16) may raise `ImportError: cannot import name 'NaN' from 'numpy'`. This is due to `numpy.NaN` being deprecated in favor of `numpy.nan`.
fix
Upgrade to `ft-pandas-ta` 0.3.16 or newer. If the error persists, consider downgrading NumPy to `numpy==1.26.3` or manually patching the `squeeze_pro.py` file (as detailed for original `pandas-ta`) by changing `from numpy import NaN as npNaN` to `from numpy import nan as npNaN` if your installed `ft-pandas-ta` version still contains this issue.
affects: Potentially <0.3.16 or specific environments with older NumPy.
gotchaSome indicators require specific DataFrame column names (e.g., 'open', 'high', 'low', 'close', 'volume'). If these columns are missing or incorrectly named, a `KeyError` will occur.
fix
Ensure your DataFrame contains the expected OHLCV columns, typically lowercased. Rename columns if necessary (e.g., `df.columns = df.columns.str.lower()`).
affects: All
breakingPandas 3.0 introduced significant changes to copy/view semantics, deprecating `SettingWithCopyWarning` and enforcing explicit modifications. Chained assignments like `df[df['col'] > 0]['new_col'] = value` no longer work reliably. This could affect how you manipulate DataFrames with `ft-pandas-ta` results.
fix
Adopt explicit modification patterns, especially using `.loc` for assignment: `df.loc[df['col'] > 0, 'new_col'] = value`. Understand the new Copy-on-Write behavior in Pandas 3.0.
affects: Pandas >=3.0
Errors
Common errors & fixes
ImportError: cannot import name 'NaN' from 'numpy'
The `ft-pandas-ta` library (or underlying `pandas-ta` module) is trying to import `NaN` from `numpy`, but modern NumPy (e.g., 2.0+) uses `nan` (lowercase).
fix
Upgrade `ft-pandas-ta` to 0.3.16 or newer (`pip install --upgrade ft-pandas-ta`). If the problem persists, you might need to downgrade `numpy` to an older version like `numpy==1.26.3` or manually edit the problematic `ft-pandas-ta` source file if a fix isn't available.
KeyError: 'close'
An indicator function was called on a DataFrame, but the required 'close' column (or other OHLCV columns like 'open', 'high', 'low', 'volume') was not found.
fix
Verify that your DataFrame has columns named 'open', 'high', 'low', 'close', 'volume' (case-insensitive for the `.ta` accessor but explicit calls require exact names). Rename columns if necessary (e.g., `df.columns = df.columns.str.lower()`).
AttributeError: 'DataFrame' object has no attribute 'ta'
The `pandas_ta` module was not imported, or it was imported in a way that did not activate the DataFrame extension. The `.ta` accessor is added to DataFrames upon importing `pandas_ta`.
fix
Ensure you have `import pandas_ta as ta` (or similar) at the beginning of your script. This import statement activates the `.ta` accessor for all Pandas DataFrames.
TypeError: Cannot compare types '_____' and '_____' (for example, string and int) when performing operations involving indicator calculations.
Input columns for indicators contain mixed data types or non-numeric types (e.g., strings) where numbers are expected.
fix
Inspect the `dtypes` of your DataFrame columns, especially those used in indicator calculations. Convert relevant columns to numeric types (e.g., `pd.to_numeric(df['column'], errors='coerce')`) and handle any `NaN` values that result from coercion.
Upgrade
Version history
0.3.16latest on PyPI · released Sep 29, 2025
Audit
Dependencies
pandasrequiredCore data structure for time series and DataFrame extension.
numpyrequiredNumerical operations and array handling.
Agent activity
10 hits · last 30 days
node
10
Resources