Pandas Basics
Review the Pandas documentation, if not proficient, and more specifically the following concepts of Series and DataFrames and DataFrame Extensions.
What is a Pandas Series and DataFrame?
- Pandas Series
- Pandas DataFrame
- Pandas DataFrame Extension
Series vs DataFrame Column Count
Properties#
The "ta" extension has some optional properties that may be of use when using ohlcv data.
adjusted#
Get/Set the adjusted_close column.
Mode:
- Get: The adjusted column as
str
. - Set: The column
name
, to set as the adjusted column. Default:None
config#
Get/Set the configuration file path.
Mode:
- Get: The path of the config file as
str
. Default:"~/.config/pandas-ta/settings.json"
- Set: The path to the config file.
NOTICE
Thanks to all those that have sponsored and dontated to the library in the past! Your support has been greatly appreciated!
However, future releases are on definite hold until 100+ donations of $150+ have been received via Buy Me a Coffee.
Help keep this library and application the best in it's class!
cores#
Manage the number of cpus
to utilize for multiprocessing.
Mode:
- Get: The number of
cores
for multiprocessing asInt
. - Set: The number of
cores
Default:None
Disable multiprocessing
Set: df.ta.cores = 0
Multiprocessing caveats
- Multiprocessing will not work when using the following keys:
"col_names"
. - Multiprocessing may not work or complete as expected when indicator chaining.
- Chained indicators use non-default, ohlcv, sources as input Series.
exchange#
A label property of the major exchange the ohlcv data is associated with.
Mode:
- Get: The
exchange
as astr
. - Set: The
exchange
. Must be one of the followingta.EXCHANGE_TZ.keys()
. Default:"NYSE"
time_range#
Useful for annualization.
Mode:
- Get: Time elapsed between the first and last DateTemeIndex as
float
. - Set: Default:
"years"
See Also
- Options:
"months", "weeks", "days", "hours", "minutes"
and"seconds"
. Default:"years"
.
NOTICE
Thanks to all those that have sponsored and dontated to the library in the past! Your support has been greatly appreciated!
However, future releases are on definite hold until 100+ donations of $150+ have been received via Buy Me a Coffee.
Help keep this library and application the best in it's class!
Methods#
constants
Concatenate / Drop constant(s) to the DataFrame.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
append | bool | Concatenate if | required |
values | Array | List/Numpy array of | required |
Returns:
Type | Description |
---|---|
(Series, DataFrame, None) | Depends upon parameters. |
See Also
datetime_ordered
DataFrame DateTime ordered?
Returns:
Type | Description |
---|---|
bool |
|
help
Help!
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s | str | String to search for. Default: | '' |
Returns:
Type | Description |
---|---|
None | TextIO | Opens web browser to relevant Pandas TA website page or prints all search keywords. |
indicators
List indicators.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
as_list | bool | Return as a list. Default: | None |
exclude | ListStr | The passed in list will be excluded from the indicators list. Default: | None |
Returns:
Type | Description |
---|---|
TextIO | ListStr | Prints list or returns a |
last_run
Detailed string of last run time.
Returns:
Type | Description |
---|---|
str | Detailed date and time of the lastest run. |
study
Applies the ta
listed in a Study
.
Other Parameters:
Name | Type | Description |
---|---|---|
chunksize | int | Multiprocessing Pool chunksize. Default: |
cores | int | Number of Multiprocessing cores. Default: |
exclude | ListStr | List of indicator names. Default: |
ordered | bool | Run |
returns | bool | Return the DataFrame. Default: |
timed | bool | Print the process time. Default: |
verbose | bool | More verbose output. Default: |
Multiprocessing
Multiprocessing is not viable or efficient for some cases. Testing is required per case. See Multiprocessing for more information.
ticker
Download Historical ohlcv data as a Pandas DataFrame if yfinance package is installed. It also can run a ta.Study
afterwards.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ticker | str | Any string for a ticker you would use with | None |
period | str | See the yfinance | None |
interval | str | | None |
study | Study | str | After downloading, apply | None |
proxy | dict | Proxy dictionary. Default: | None |
timed | bool | Print download time to stdout. Default: | False |
Returns:
Type | Description |
---|---|
DataFrame | None | ohlcv |