Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_functions_df and get_functions_grouped_df to __init__.py #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion talib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,25 @@ def get_function_groups():
"""
return __function_groups__.copy()

__all__ = ['get_functions', 'get_function_groups']
def get_functions_df():
"""
Returns a Pandas DataFrame of all the functions supported by TALIB
"""
import pandas as pd
lst_info = []
for f in get_functions():
absf = abstract.Function(f)
lst_info.append(absf.info)
df_absf = pd.DataFrame(lst_info)
df_absf = df_absf.set_index('name')
return(df_absf)

def get_functions_grouped_df():
"""
Returns a Pandas DataFrame of all the functions supported by TALIB grouped by "group"
"""
df_absf = get_functions_df()
df_grp = df_absf.reset_index().set_index(['group', 'name']).sortlevel(0)
return(df_grp)

__all__ = ['get_functions', 'get_function_groups', 'get_functions_df', 'get_functions_grouped_df']