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

Slice Copy error #122

Open
charlesedwards opened this issue Feb 20, 2020 · 0 comments
Open

Slice Copy error #122

charlesedwards opened this issue Feb 20, 2020 · 0 comments

Comments

@charlesedwards
Copy link

Hi,

When I run a simple command to add TA lib indicators to a Pandas Dataframe (in Python3), I get the slice copy error. Will this be resolved in the next release?

Code (were df is a pandas dataframe)

ta.add_trend_ta(
    df,
    colprefix="BTC:",
    **{k: "BTC:" + k for k in ['high', 'low', 'close']}
)

Note: the calculation work, but I get a lot of the following error messages.

Error Message:

C:\ProgramData\Anaconda3\lib\site-packages\ta\wrapper.py:95: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  close=df[close], high=df[high], low=df[low], n=10, fillna=fillna).average_true_range()
C:\ProgramData\Anaconda3\lib\site-packages\ta\wrapper.py:99: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  df[f'{colprefix}volatility_bbm'] = indicator_bb.bollinger_mavg()
C:\ProgramData\Anaconda3\lib\site-packages\ta\wrapper.py:100: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  df[f'{colprefix}volatility_bbh'] = indicator_bb.bollinger_hband()
C:\ProgramData\Anaconda3\lib\site-packages\ta\wrapper.py:101: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  df[f'{colprefix}volatility_bbl'] = indicator_bb.bollinger_lband()
C:\ProgramData\Anaconda3\lib\site-packages\ta\wrapper.py:102: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  df[f'{colprefix}volatility_bbw'] = indicator_bb.bollinger_wband()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant